https配置
【nginx.conf】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | user www www; worker_processes 4; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; } 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"' '$connection $upstream_addr ' 'upstream_response_time $upstream_response_time request_time $request_time ' ; #access_log logs/access.log main; sendfile on; tcp_nopush on; server_tokens off; keepalive_timeout 180; tcp_nodelay on; gzip on; gzip_comp_level 5; gzip_min_length 1k; gzip_buffers 8 256k; gzip_http_version 1.0; gzip_types text /plain application /x-javascript text /css application /xml ; gzip_vary on; postpone_output 1460; client_header_buffer_size 512k; server { listen 80; server_name localhost; root /var/www/html/test/ ; #access_log /usr/local/nginx/logs/default.access.log main; location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x .html; location = /50x .html { root html; } location ~ \.php$ { fastcgi_index index.php; include fastcgi_params; fastcgi_connect_timeout 120; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 1024k; fastcgi_buffers 32 1024k; } location ~ .*\.(css|js|swf|jpg|gif|png|jpep|jpg|mp3|xx|xmlbak|xml)$ { expires 15d; } location ~ .*\.(js|css)?$ { expires 1d; } } include vhost/*.conf; } |
___________________________________________________________________________________________________________________________________________________
w.xxxxxx.com.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | server { listen 443; server_name w.xxxxxx.com; ssl on; #charset utf-8; index index.html index.htm index.php; root /var/www/html/w ; ssl_certificate /usr/local/openresty/cert/214 .pem; ssl_certificate_key /usr/local/openresty/cert/214 .key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; #location / { # if (!-e $request_filename) { # rewrite ^/(.*)$ /index.php?$1 last; # } #} location /api/ { root html; index index.html index.htm; proxy_pass https: //api .xxxxxx.com/; } access_log /home/www/log/nginx/w .xxxxxx.com.log main; error_log /home/www/log/nginx/w .xxxxxx.com.nginx_error.log; location /callback/ { ##rewrite ^/callback/(.*) /$1 break; ##proxy_redirect off; proxy_pass http: //api .xxxxxx.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Authorization $http_authorization; } location /mapi { ##rewrite ^/callback/(.*) /$1 break; ##proxy_redirect off; proxy_pass http: //api .xxxxxx.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Authorization $http_authorization; } location ~ \.php$ { fastcgi_index index.php; include fastcgi_params; } location = /favicon .ico { log_not_found off; access_log off; } } |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步