This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
nginx [2021/02/10 21:46] 127.0.0.1 external edit |
nginx [2023/03/08 16:09] (current) xujianglong ↷ Page moved from 内部资料:nginx to nginx |
||
---|---|---|---|
Line 7: | Line 7: | ||
参考[[https:// | 参考[[https:// | ||
+ | [[https:// | ||
+ | |||
+ | ===== Nginx配置ssl证书报错解决方案 ===== | ||
+ | |||
+ | [[https:// | ||
====== Nginx配置Host以便响应服务器获取跳转前的地址 ====== | ====== Nginx配置Host以便响应服务器获取跳转前的地址 ====== | ||
Line 19: | Line 24: | ||
</ | </ | ||
+ | |||
+ | ====== Nginx域名解析(反向代理) ====== | ||
+ | |||
+ | 以Ubuntu为例,编辑/ | ||
+ | |||
+ | <code bash> | ||
+ | server { | ||
+ | listen | ||
+ | server_name | ||
+ | error_log / | ||
+ | | ||
+ | add_header Cache-Control public; | ||
+ | | ||
+ | location / { | ||
+ | proxy_pass | ||
+ | proxy_redirect off; | ||
+ | | ||
+ | proxy_set_header X-Real-IP $remote_addr; | ||
+ | proxy_set_header X-Forwarded-Host $host; | ||
+ | proxy_set_header X-Forwarded-Server $host; | ||
+ | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
+ | proxy_set_header X-Forwarded-Proto $scheme; | ||
+ | # 转发host信息 | ||
+ | proxy_set_header Host $host; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **如果域名映射地址是wordpress,可能会出现跳转后的地址包含端口的情况,到wordpress管理端中修改url配置即可。** |