差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
it:server:nginxserver [2022-08-03 16:30] – [反向代理] goldentianyait:server:nginxserver [2025-12-30 14:51] (当前版本) – 移除 goldentianya
行 1: 行 1:
-====== Nginx 服务器 ====== 
-主要关于Nginx服务器安装、维护等事项。 
  
-===== 安装 ===== 
-安装和多域名设置,主要参考以下文章:(([[https://ubiq.co/tech-blog/configure-multiple-host-names-nginx/|How To Configure Multiple Host Names in NGINX]])) (([[https://hackprogramming.com/blog/how-to-setup-subdomain-or-host-multiple-domains-using-nginx-in-linux-server|How to setup subdomain or host multiple domains using nginx in linux server]])) 
-(([[https://hackprogramming.com/how-to-setup-subdomain-or-host-multiple-domains-using-nginx-in-linux-server/|Subdomain in Nginx]])) 
-(([[https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04-quickstart-de|Installl Nginx on Ubuntu]])) 
-(([[https://www.youtube.com/watch?v=liA6Wg-mm2M|Install Video]])) 
-(([[https://blog.csdn.net/longgeqiaojie304/article/details/84984564|Nginx虚拟主机多host域名配置演示]])) 
-按照步骤去做就好,没有太复杂。 
- 
-<code> 
-sudo apt update 
-sudo apt install nginx 
- 
-sudo systemctl status nginx 
-sudo systemctl reload nginx 
-</code> 
- 
-安装完并修改配置文件后,检查配置语法是否正确 
-<code bash> 
-sudo nginx -t -c dokuwiki.conf  # 测试配置文件是否有效 
-sudo nginx -t                   # 测试所有设置 
-</code> 
- 
-端口配置 
-<code bash> 
-sudo ufw allow 'Nginx Full' 
-sudo ufw enable 
-sudo ufw status 
-sudo ufw allow ssh # 很重要,否则 SSH 登录会被拒绝 
-</code> 
- 
-如果出现502拒绝访问,大概是因为php解释服务没有安装。参考 [[https://www.datadoghq.com/blog/nginx-502-bad-gateway-errors-php-fpm/|NGINX 502 Bad Gateway: PHP-FPM]] 
-<code bash> 
-sudo apt -y install php7.4 php7.4-fpm # ubuntu 20.04 上只支持 7.4 版本 
-</code> 
- 
-出现 “//PHP function xml_parser_create// ” 错误,是因为 php-xml 包没有安装。 
-<code bash> 
-sudo apt-get install php-xml 
-</code> 
- 
-====== SSL 证书 ====== 
-请参阅 [[it:server:security#'SSL 证书'|服务器安全设置]] 笔记中的记述。以开通''https''的安全访问模式。 
- 
-====== 反向代理 ====== 
- 
-当访问 http://192.168.17.129:9001/deu/a.html 时,会引导到 http://127.0.0.1:8080 
-<code > 
-server { 
- listen       9001; 
- server_name  192.168.17.129; 
- 
- location ~ /edu/ { 
- proxy_pass  http://127.0.0.1:8080 
- } 
- 
- location ~ /vod/ { 
- proxy_pass  http://127.0.0.1:8081 
- } 
-} 
- 
-</code> 
- 
-{{tag>nginx}} 
it/server/nginxserver.1659544201.txt.gz · 最后更改: 2022-08-03 16:30 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0