I follow Penguin"s code to implement nginx configuration (parameters have been modified and can be accessed)
now there are several problems:
1. What is the first upstream?
2. I now jump to https, every time I visit http, even if I delete rewrite, how to separate
3. How to hang a static website under the https domain name? I tried to set root root/myweb; to return
upstream app_weapp {
server localhost:5757;
keepalive 8;
}
server {
listen 80;
server_name wx.ijason.cc;
rewrite ^(.*)$ https://$server_name$1 permanent;
}
server {
listen 443;
server_name wx.ijason.cc;
ssl on;
ssl_certificate /data/release/nginx/1_wx.ijason.cc_bundle.crt;
ssl_certificate_key /data/release/nginx/2_wx.ijason.cc.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
ssl_session_cache shared:SSL:50m;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://app_weapp;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}