憶の年

nginx反向代理
带ssl配置server { listen 80; server_name www.2x0.cn 2x0....
扫描右侧二维码阅读全文
04
2016/04

nginx反向代理

带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;
    }
Last modification:April 4th, 2016 at 03:08 pm

One comment

  1. 妖夏

    不是妹纸差评

Leave a Comment