问题:无法访问在一台 nginx 服务器下处理的两个网站,即<<ip-address>>
&<<ip-address>>/web2
数字海洋上的配置:
- 1 滴 / Ubuntu 18 / LEMP
- 我在 CodeIgniter 框架中有两个测试 PHP 网站
- 第一个网站的文件夹配置:
/var/www/html/web1/
- 第二个网站的文件夹配置:
/var/www/html/web2/
两个站点的 Nginx Server Block 配置
web1.com
server {
listen 80;
root /var/www/html/web1;
index index.php index.html index.htm index.nginx-debian.html;
server_name <<ip-address>>;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
web2.com
server {
listen 80;
root /var/www/html/web2;
index index.php index.html index.htm index.nginx-debian.html;
server_name <<ip-address>>/web2;
location /web2/ {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
我对nginx服务器完全陌生,我是根据数字海洋下社区提供的文档来做的。
请帮忙!
谢谢。