日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

Nginx 安装配置【必须把文件到放到机器上】

發布時間:2023/12/18 Nginx 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx 安装配置【必须把文件到放到机器上】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

【必須把所有下載的gz文件到放到機器上;編譯】

1.安裝nginx之前的編譯軟件

yum -y install make zlib zlib-devel gcc-c++ libtool ?openssl openssl-devel

make 命令安裝

zlib 和 zlib-devel 解壓命令安裝:

red hat:wget https://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz/download -o zlib-1.2.8.tar.gz
ubuntu:apt install zlib1g

gcc 的安裝
g++ 的安裝

libtool 通用庫工具的安裝 ubuntu:sudo apt install?libtool
Ubuntu:sudo apt-get install zlib1g-dev
Ubuntu:sudo apt-get install g++
openssl 一個安全套接字層密碼庫


二、首先要安裝 PCRE

PCRE 作用是讓 Nginx 支持 Rewrite 功能。

1、下載 PCRE 安裝包,下載地址:wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz

daokr#wget http://downloads.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz

2、解壓安裝包:

[root@dksrc]# tar zxvf pcre-8.33.tar.gz

3、進入安裝包目錄

[root@dksrc]# cd pcre-8.33

4、編譯安裝?

[root@dkpcre-8.35]# ./configure --prefix=/usr/local/src/pcre-8.33 [root@dkpcre-8.35]# make?&& make install

? ? 查找pcre 的默認安裝路徑?

root@VM-0-4-ubuntu:/# find -name pcre ./home/ubuntu/downfile/nginx-1.5.8/auto/lib/pcre

?

如果報錯看下面鏈接:

ubuntu編譯PCRE時出現 line 81: aclocal-1.14: command not found錯誤

?

5、查看pcre版本

[root@dkpcre-8.35]# pcre-config --version

?

安裝openssl

1.下載地址?

root:wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz

2.編輯配置安裝路徑

root:./config --prefix=/usr/local/src/openss-1.0

3.輸入make && make install 安裝

make && make install

4.查看版本

daokr#openssl version -a

安裝 Nginx

1、下載 Nginx,下載地址:http://nginx.org/download/nginx-1.5.8.tar.gz

[root@dk src]#wget?http://nginx.org/download/nginx-1.5.8.tar.gz

2、解壓安裝包

[root@dksrc]# tar zxvf nginx-1.5.8.tar.gz

3、進入安裝包目錄

[root@dksrc]# cd nginx-1.5.8

4、編譯安裝

[root@dknginx-1.6.2]# ./configure --prefix=/home/nginx --with-http_stub_status_module --with-http_ssl_module --with-openssl=/home/daokr/downfile/openssl-1.0.2h --with-pcre=/home/daokr/downfile/pcre-8.33 [root@dknginx-1.6.2]# make [root@dknginx-1.6.2]# make install

在編譯的時候如果沒有出現 creating objs/Makefile 這行;說明哪里錯了;要按錯誤來修改
這里有個坑;就是

--with-openssl--with-pcre 的路徑 是壓縮包解壓后源文件;千萬別搞錯了路徑

5、查看nginx版本

[root@dknginx-1.6.2]# /usr/local/webserver/nginx/sbin/nginx -v

到此,nginx安裝完成。

Nginx 配置

創建 Nginx 運行使用的用戶 www:

添加用戶組www

添加用戶并賦予www的權限組

[root@dk conf]# groupadd www? [root@dk conf]# useradd -g www www

配置nginx.conf ,將/usr/local/webserver/nginx/conf/nginx.conf替換為以下內容

默認配置:

?啟動地址:/usr/sbin/nginx 下面關閉

root@DK:/usr/sbin# ./nginx root@DK:/usr/sbin# ps -ef|grep nginx root 25113 1 0 10:15 ? 00:00:00 nginx: master process ./nginx www 25114 25113 0 10:15 ? 00:00:00 nginx: worker process root 25118 25074 0 10:15 pts/22 00:00:00 grep --color=auto nginx

?

?

?

測試配置是否正確命令:

root@DK:/etc/nginx# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

?

啟動和停用:

Nginx 其他命令 以下包含了 Nginx 常用的幾個命令: /usr/local/webserver/nginx/sbin/nginx -s reload # 重新載入配置文件 /usr/local/webserver/nginx/sbin/nginx -s reopen # 重啟 Nginx /usr/local/webserver/nginx/sbin/nginx -s stop # 停止 Nginx

?

?安裝完成后簡單的修改下配置文件:

user www www; worker_processes 1;#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events {worker_connections 1024; }http {include mime.types;default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '# '$status $body_bytes_sent "$http_referer" '# '"$http_user_agent" "$http_x_forwarded_for"';#access_log logs/access.log main; sendfile on;#tcp_nopush on;#keepalive_timeout 0;keepalive_timeout 65;#gzip on;server {listen 1180;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;set $root_path "/home/daokr/web";root $root_path;index index.php index.html index.htm;location / {root html;index index.html index.htm;}#error_page 404 /404.html; # redirect server error pages to the static page /50x.html #error_page 500 502 503 504 /50x.html;location = /50x.html { root html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {# proxy_pass http://127.0.0.1; #}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {# root html;# fastcgi_pass 127.0.0.1:9000;# fastcgi_index index.php;# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht { # deny all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {# listen 8000;# listen somename:8080;# server_name somename alias another.alias;# location / {# root html;# index index.html index.htm;# }#}# HTTPS server##server {# listen 443 ssl;# server_name localhost;# ssl_certificate cert.pem;# ssl_certificate_key cert.key;# ssl_session_cache shared:SSL:1m;# ssl_session_timeout 5m;# ssl_ciphers HIGH:!aNULL:!MD5;# ssl_prefer_server_ciphers on;# location / {# root html;# index index.html index.htm;# }#}}

?

?

下面是工作的實際的nginx配置:

#user oracle.dba; worker_processes 8; worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000; pid /home/nginx/logs/nginx.pid;#Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 65535;events {use epoll;worker_connections 10240; }http {include mime.types;default_type application/octet-stream;server_tokens off;server_names_hash_bucket_size 128;client_header_buffer_size 4k;large_client_header_buffers 4 32k;client_max_body_size 64m;sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 60s;open_file_cache max=10240 inactive=20s;open_file_cache_valid 60s;open_file_cache_min_uses 1;fastcgi_connect_timeout 180s;fastcgi_send_timeout 180s;fastcgi_read_timeout 180s;fastcgi_buffer_size 64k;fastcgi_buffers 4 64k;fastcgi_busy_buffers_size 128k;fastcgi_temp_file_write_size 128k;proxy_connect_timeout 180s;proxy_read_timeout 180s;proxy_send_timeout 180s;proxy_buffer_size 64k;proxy_buffers 4 64k;proxy_busy_buffers_size 128k;gzip on;gzip_min_length 1k;gzip_buffers 4 64k;gzip_http_version 1.0;gzip_comp_level 2;gzip_types text/plain application/x-javascript text/css application/xml;gzip_vary on;include server/*.txt;#access loger formatlog_format access '$remote_addr $http_x_forwarded_for $remote_user [$time_local] "$request" [$request_length/$bytes_sent] ''$status "$http_referer" "$http_user_agent"';access_log logs/access.log access;log_not_found off;open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2;error_log /home/nginx/logs/error.log error;# limit_zone crawler; # $binary_remote_addr 10m;#WebSocket Upgrade#map $http_upgrade $connection_upgrade #{# default upgrade;# '' close;#}#server #{# #WebSocket Proxy Port# listen 12800;# server_name localhost;## location / # {# #PHP WebSocket port# proxy_pass http://localhost:12801;# proxy_set_header X-Real-IP $remote_addr;# proxy_set_header Host $host;# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;## proxy_http_version 1.1;# proxy_set_header Upgrade $http_upgrade;# proxy_set_header Connection "upgrade";# }#}server {##---xpass-1.0.0---##listen 20030;server_name localhost;charset utf-8;##ssl configure #ssl on; #ssl_certificate cert/lianyinggufen_com.crt;#ssl_certificate_key cert/lianyinggufen_com.key; #ssl_session_timeout 5m; #ssl_protocols SSLv3 TLSv1; #ssl_ciphers HIGH:!ADH:!EXPORT56:RC4+RSA:+MEDIUM; #ssl_prefer_server_ciphers on; ## phalcon-configset $root_path "/home/oracle/xpass-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|apk|ipa|plist)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}} server {##---xpay-1.0.0(http)---##listen 20031;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xpay-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx|zip|uploads|xml|rar)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}} # # server # { # ##---wxqyh---## # listen 20038; # server_name localhost; # charset utf-8; # # ## phalcon-config # set $root_path "/home/oracle/wxqyh-1.0.0/public"; # # root $root_path; # index index.php index.html index.htm; # try_files $uri $uri/ @rewrite; # # #for document_root - ajax request # location / # { # rewrite ^(.*)$ /index.php?_url=$1; # } # # #for all others # location @rewrite # { # rewrite ^/(.*)$ /index.php?_url=$1; # } # # location ~ \.php # { # # try_files $uri = 404; # fastcgi_index index.php; # # # fastcgi_pass 127.0.0.1:9000; # fastcgi_pass unix:/tmp/php-cgi.sock; # # include fastcgi_params; # fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_param PATH_INFO $fastcgi_path_info; # fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # } # # # cache folder # # location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$ # # # cache file type # location ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)$ # { # root $root_path; # access_log off; # expires 30d; # } # # location ~ \.ico # { # root $root_path; # access_log off; # expires 30d; # } # # location ~ /\.ht # { # deny all; # } # } #server {##---xmer-1.0.0---##listen 20033;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xmer-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xagent-1.0.0---##listen 20034;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xagent-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xserv-1.0.0---##listen 20035;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xserv-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xfinance-1.0.0---##listen 20036;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xfinance-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xapp-1.0.0 SSL---##listen 20037;server_name localhost;charset utf-8;##ssl configure ssl on; ssl_certificate ssl/boshang.crt;ssl_certificate_key ssl/boshang.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers HIGH:!ADH:!EXPORT56:RC4+RSA:+MEDIUM; ssl_prefer_server_ciphers on;## phalcon-configset $root_path "/home/oracle/xapp-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx|exe|app|appfile)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xapp-1.0.0 not ssl---##listen 20042;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xapp-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---XOPEN-1.0.0---##listen 20041;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xopen-1.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---XOPEN-1.0.0---##listen 20046;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xdemo";root $root_path;index index.php index.html index.htm;#try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{#rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {#rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx|html|htm|http)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}#server #{# ##---xweixin-1.0.0---### listen 20041;# server_name localhost;# charset utf-8;## ## phalcon-config# set $root_path "/home/oracle/xweixin-1.0.0/public";# # root $root_path;# index index.php index.html index.htm;# try_files $uri $uri/ @rewrite;# # #for document_root - ajax request# location /# {# rewrite ^(.*)$ /index.php?_url=$1;# }# # #for all others# location @rewrite # {# rewrite ^/(.*)$ /index.php?_url=$1;# }# # location ~ \.php # {# # try_files $uri = 404;# fastcgi_index index.php;# # # fastcgi_pass 127.0.0.1:9000;# fastcgi_pass unix:/tmp/php-cgi.sock;# # include fastcgi_params;# fastcgi_split_path_info ^(.+\.php)(/.+)$;# fastcgi_param PATH_INFO $fastcgi_path_info;# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;# }# # # cache folder# # location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# # # cache file type# location ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)$# {# root $root_path;# access_log off;# expires 30d; # }## location ~ \.ico# {# root $root_path;# access_log off;# expires 30d; # }## location ~ /\.ht # {# deny all;# }#}##server #{# ##---xca-1.0.0---### listen 20044;# server_name localhost;# charset utf-8;## ## phalcon-config# set $root_path "/home/oracle/xca-1.0.0/public";# # root $root_path;# index index.php index.html index.htm;# try_files $uri $uri/ @rewrite;# # #for document_root - ajax request# location /# {# rewrite ^(.*)$ /index.php?_url=$1;# }# # #for all others# location @rewrite # {# rewrite ^/(.*)$ /index.php?_url=$1;# }# # location ~ \.php # {# # try_files $uri = 404;# fastcgi_index index.php;# # # fastcgi_pass 127.0.0.1:9000;# fastcgi_pass unix:/tmp/php-cgi.sock;# # include fastcgi_params;# fastcgi_split_path_info ^(.+\.php)(/.+)$;# fastcgi_param PATH_INFO $fastcgi_path_info;# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;# }# # # cache folder# # location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# # # cache file type# location ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)$# {# root $root_path;# access_log off;# expires 30d; # }## location ~ \.ico# {# root $root_path;# access_log off;# expires 30d; # }## location ~ /\.ht # {# deny all;# }#}server {##---xwebs---##listen 20044;server_name localhost;charset utf-8;## phalcon-configset $root_path "/home/oracle/xwebs/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(.+)/(js|css|img|images|flv|swf|fonts|download|product)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {##---xcar-1.0.0 SSL---##listen 20050;server_name localhost;charset utf-8;##ssl configure ssl on; ssl_certificate ssl/xcar.cer;ssl_certificate_key ssl/xcar.pem; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers HIGH:!ADH:!EXPORT56:RC4+RSA:+MEDIUM; ssl_prefer_server_ciphers on;## phalcon-configset $root_path "/home/oracle/xcars-1.0.0/public";root $root_path;index index.php index.html index.htm;try_files $uri $uri/ @rewrite;#for document_root - ajax requestlocation /{rewrite ^(.*)$ /index.php?_url=$1;}#for all otherslocation @rewrite {rewrite ^/(.*)$ /index.php?_url=$1;}location ~ \.php {# try_files $uri = 404;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/tmp/php-cgi.sock;include fastcgi_params;fastcgi_split_path_info ^(.+\.php)(/.+)$;fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}# cache folder# location ~* ^/(js|css|img|images|flv|swf|fonts|download)/(.+)$# cache file typelocation ~* .(js|css|jpg|jpeg|gif|png|flv|swf|ttf|svg|eot|woff|download|xlsx|exe|app|appfile)${root $root_path;access_log off;expires 30d; }location ~ \.ico{root $root_path;access_log off;expires 30d; }location ~ /\.ht {deny all;}}server {listen 5601;server_name localhost;charset utf8;location / {auth_basic "Restricted Access";auth_basic_user_file /home/nginx/conf/htpasswd.users; proxy_pass http://10.8.21.124:5601$request_uri;proxy_set_header Host $http_host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;} }} tcp { timeout 1d; proxy_read_timeout 1d; proxy_send_timeout 1d; proxy_connect_timeout 14400;# ------ 192.168.2.11(oracle proxy) ------upstream oracle_11521 {server localhost:21521;check interval=3000 rise=4 fall=5 timeout=3000 type=tcp;} server {listen 11521;proxy_pass oracle_11521;so_keepalive on; tcp_nodelay on;} }

?

?

轉載于:https://www.cnblogs.com/wanglijun/p/8693814.html

總結

以上是生活随笔為你收集整理的Nginx 安装配置【必须把文件到放到机器上】的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产做a | 一级激情片 | 日韩欧美在线观看视频 | 99mav| www.四虎影视 | 久久综合伊人 | 91久久视频 | 黄网站欧美内射 | 男人操女人的软件 | 日韩成人一区二区三区 | 正在播放日韩 | 久久久美女视频 | 亚洲人体视频 | 日韩欧美国产一区二区三区 | 国产免费脚交足视频在线观看 | 久久精品在线视频 | 高潮av| 播播激情网 | 国产一区二区91 | 怡春院一区二区 | 嫩草视频在线 | 玖玖精品在线视频 | 精品久久二区 | wwwav视频在线观看 | 亚洲欧美日韩精品在线观看 | 91一区二区三区四区 | 日本伦理片在线看 | 久久色中文字幕 | www.日韩欧美 | 欧美三日本三级少妇99 | 拔插拔插海外华人免费视频 | 日本一道本在线 | 日韩123区| 开心六月婷婷 | 中文字幕高清在线免费播放 | 天天操夜夜干 | 校霸被c到爽夹震蛋上课高潮 | 丁香啪啪综合成人亚洲 | 在线观看网站 | www.欧美在线 | 国产女主播福利 | 日本a在线 | 色啦啦视频 | 性欧美bb| 国产情侣免费视频 | 91欧美亚洲 | 成年人免费在线观看视频网站 | 综合天天色 | 欧美日韩资源 | 青草视频免费观看 | 天堂中文资源在线观看 | 老女人一毛片 | 青草视频在线观看视频 | 国产午夜亚洲精品午夜鲁丝片 | 六月婷婷久久 | 3p在线播放 | 国产精品91一区二区 | 国产免费观看一区 | 无码专区久久综合久中文字幕 | 怒海潜沙秦岭神树 | 亚洲成人精品久久久 | 久久精品久久精品久久精品 | 成人午夜视频在线播放 | 国产精品一区二区三区高潮 | 丁香婷婷激情五月 | 狂野欧美性猛交blacked | 国产日韩精品久久 | 亚洲九九九九 | 黄色激情视频网站 | 日韩一区二区影视 | 国产美女又黄又爽又色视频免费 | 亚洲视频观看 | 老司机激情影院 | 国产精品丝袜黑色高跟鞋 | 久操视频在线观看 | 禁断介护av | 午夜精品久久久久久久99热黄桃 | 久久99精品久久久久久园产越南 | 欧美亚洲丝袜 | 岛国av免费看 | 欧美午夜精品一区二区三区电影 | 亚洲AV无码成人精品区明星换面 | 欧美高大丰满少妇xxxx | 三男一女吃奶添下面 | 卡通动漫精品一区二区三区 | 91女人18毛片水多国产 | 色婷婷aⅴ一区二区三区 | 成人在线视频播放 | 中文字幕一区二区三区四区 | 秋霞福利网 | 日韩av高清无码 | 啪网址| 伊人网在线视频 | 伊人久久一区二区三区 | 色倩网站| 成 人 免费 黄 色 | 国精品一区二区三区 | 欧美日韩中文国产一区发布 | 97国产在线播放 |