User Tools

Site Tools


nginx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04|How To Secure Nginx with Let's Encrypt on Ubuntu 16.04]] 参考[[https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04|How To Secure Nginx with Let's Encrypt on Ubuntu 16.04]]
  
 +[[https://www.trustasia.com/news-201801-nginx-server-certificate-deployment|Nginx配置百度云ssl证书教程]]
 +
 +===== Nginx配置ssl证书报错解决方案 =====
 +
 +[[https://www.cnblogs.com/faithfu/p/12697762.html|SSL证书报错:X509_check_private_key:key values mismatch]]
 ====== Nginx配置Host以便响应服务器获取跳转前的地址 ====== ====== Nginx配置Host以便响应服务器获取跳转前的地址 ======
  
Line 19: Line 24:
 </code> </code>
  
 +
 +====== Nginx域名解析(反向代理) ======
 +
 +以Ubuntu为例,编辑/etc/nginx/conf.d/<site-name>.conf
 +
 +<code bash>
 +server {                    
 +    listen       80;        
 +    server_name  www.codedemo.club;
 +    error_log /mengyunzhi/log/baeldung.cn-nginx.log info;
 +                            
 +    add_header Cache-Control public;
 +                            
 +    location / {            
 +        proxy_pass      http://127.0.0.1:8000;
 +        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;
 +    }
 +}
 +</code>
 +
 +**如果域名映射地址是wordpress,可能会出现跳转后的地址包含端口的情况,到wordpress管理端中修改url配置即可。**
nginx.1612964791.txt.gz · Last modified: 2021/02/10 21:46 by 127.0.0.1