1. 首页
  2. 喵~

【笔记】nginx反代ngrok的问题

转载自https://segmentfault.com/q/1010000004277269

asus

反正是自己有用啦。免得以后忘记了。。


server {    
    listen  80;  
    server_name *.0n0.win;  
      
    root   html;
    index  index.html index.htm index.php;
 
    ## send request back to apache ##
    location / {
        proxy_pass  http://127.0.0.1:81;
        #Proxy Settings
        proxy_redirect     off;
        #proxy_set_header Host downloads.openwrt.org;
        proxy_set_header   Host             $host:81;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_max_temp_file_size 0;
        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;
        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
   }
}  

server {
    listen 443;
    server_name *.0n0.win;
 
    ssl on;
    ssl_certificate /etc/letsencrypt/live/shirakun.cc/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/shirakun.cc/privkey.pem;
#    access_log  logs/quancha.access.log  main;
#    error_log  logs/quancha.error.log;
    root   html;
    index  index.html index.htm index.php;
 
    ## send request back to apache ##
    location / {
        proxy_pass  https://127.0.0.1:444;
        #Proxy Settings
        proxy_redirect     off;
        #proxy_set_header Host downloads.openwrt.org;
        proxy_set_header   Host             $host:444;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_max_temp_file_size 0;
        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;
        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
   }
}
评分 0, 满分 5 星
0
0
看完收藏一下,下次也能找得到
  • 版权声明:本文基于《知识共享署名-相同方式共享 3.0 中国大陆许可协议》发布,转载请遵循本协议
  • 文章链接:http://moe.xin/697.html [复制] (转载时请注明本文出处及文章链接)
上一篇:
:下一篇

评论已关闭