Nginx实现反向代理例子
生活随笔
收集整理的這篇文章主要介紹了
Nginx实现反向代理例子
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
保存
server{listen 80;server_name tjise.codingce.com.cn;location / {proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-NginX-Proxy true;#你的項(xiàng)目端口號(hào)proxy_pass http://119.23.69.213:8091/;}#把http的域名請(qǐng)求轉(zhuǎn)成httpsrewrite ^(.*)$ https://$host$1 permanent; location /logs/ {autoindex off;deny all;}error_page 411 = @my_error; } server{listen 443 ssl;server_name tjise.codingce.com.cn;ssl_certificate /usr/local/nginx/cert/1_tjise.codingce.com.cn_bundle.crt;ssl_certificate_key /usr/local/nginx/cert/2_tjise.codingce.com.cn.key;ssl_session_timeout 5m;ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #請(qǐng)按照以下套件配置,配置加密套件,寫(xiě)法遵循 openssl 標(biāo)準(zhǔn)。ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on;charset utf-8;location / {proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $http_host;proxy_set_header X-NginX-Proxy true;#你的項(xiàng)目端口號(hào)proxy_pass http://119.23.69.213:8091/;}}總結(jié)
以上是生活随笔為你收集整理的Nginx实现反向代理例子的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Linux:CentOS7防火墙基本操作
- 下一篇: Nginx(二):反向代理原理 与 配置