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 82 83 84 85
| # 服务器端管理后台 server { listen 80; server_name foxhello.com www.foxhello.com; return 301 https://$host$request_uri;
# location / { # proxy_pass http://127.0.0.1:7999; # proxy_set_header Host $host:80; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_hide_header X-Powered-By; # # root /var/www/build; # index index.html; # } }
map $http_upgrade $connection_upgrade { default upgrade; '' close; }
# 代理http web server { listen 80; server_name *.foxhello.com; return 301 https://$host$request_uri;
# location / { # proxy_pass http://127.0.0.1:10580; # proxy_set_header Host $host:80; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_hide_header X-Powered-By; # # client_max_body_size 2048m; # # proxy_set_header Upgrade $http_upgrade; # proxy_set_header Connection $connection_upgrade; # } }
# 如果启用SSL server { listen 443 ssl; server_name foxhello.com www.foxhello.com;
# ssl on; ssl_certificate /etc/nginx/ssl/foxhello.com/foxhello.com.crt; ssl_certificate_key /etc/nginx/ssl/foxhello.com/foxhello.com.key; ssl_prefer_server_ciphers on; ssl_session_timeout 60m;
location / { root /var/www/build; index index.html; } }
server { listen 443 ssl; server_name *.foxhello.com;
# ssl on; ssl_certificate /etc/nginx/ssl/foxhello.com/foxhello.com.crt; ssl_certificate_key /etc/nginx/ssl/foxhello.com/foxhello.com.key; ssl_prefer_server_ciphers on; ssl_session_timeout 60m;
location / { proxy_pass http://127.0.0.1:10580; # proxy_set_header Host $host:80; proxy_set_header Host $host:443; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_hide_header X-Powered-By;
client_max_body_size 2048m;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } }
|