带ssl配置

server {
  listen 80;
  server_name www.2x0.cn 2x0.cn;
  # enforce https
  return 301 https://$server_name$request_uri;   #301跳转到443
}
server {
  listen 443 ssl;
  server_name www.2x0.cn;

  ssl_certificate /home/ssl/myssl.crt;   #ssl证书目录
  ssl_certificate_key /home/ssl/myssl.key;
        root  /home/wwwroot/www.2x0.cn;

        #error_page   404   /404.html;
      location / {  
sub_filter www.2x0.cn 127.0.0.1:8080;  
sub_filter_once off;  
proxy_set_header X-Real-IP $remote_addr;  
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
proxy_set_header Referer http://127.0.0.1:8080;  
proxy_set_header Host www.2x0.cn;  
proxy_pass http://127.0.0.1:5036;  
proxy_set_header Accept-Encoding "";  
} 


        access_log  /home/wwwlogs/www.2x0.cn.log  access;
    }

不带ssl配置

server {
  listen 80;
  server_name www.2x0.cn;

  
        root  /home/wwwroot/www.2x0.cn;

        #error_page   404   /404.html;
      location / {  
sub_filter www.2x0.cn 127.0.0.1:8080;  
sub_filter_once off;  
proxy_set_header X-Real-IP $remote_addr;  
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
proxy_set_header Referer http://127.0.0.1:8080;  
proxy_set_header Host www.2x0.cn;  
proxy_pass http://127.0.0.1:8080;  
proxy_set_header Accept-Encoding "";  
} 


        access_log  /home/wwwlogs/www.2x0.cn.log  access;
    }

如果觉得我的文章对你有用,请随意赞赏