微信小程序-nginx-https 代理后端服務


微信小程序 nginx https 反向代理后端服務

作者: 張首富
時間: 2020-12-17

nginx 配置如下

server {
        listen       443 ssl;
        server_name  test.zhangshoufu.com;
        #ssl on;
        ssl_certificate   /etc/nginx/cert/4595406__guiji.ai.pem;
        ssl_certificate_key  /etc/nginx/cert/4595406__guiji.ai.key;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;
        
        location / {
		add_header Access-Control-Allow-Origin *;
                proxy_next_upstream http_502 http_504 error timeout invalid_header;
                proxy_redirect off;
  		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  		proxy_set_header X-Real-IP $remote_addr;
  		proxy_set_header Referer 'no-referrer-when-downgrade';
  		proxy_pass  http://10.1.1.124:19033;	#替換成自己后端服務
        }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM