本帖最后由 56557775 于 2016-7-13 10:43 编辑
安装LNMP完成后,配置好虚拟主机文件。
登录192.168.1.7 出现403 forbidden提示,怎么也想不出哪里出现的问题。
cat nginx_error.log 没有错误日志
请帮忙!
默认的虚拟主机配置文件。
ls /usr/local/nginx/conf/vhosts/default.conf
server
{
listen 80 default_server;
server_name localhost;
index index.html index.htm index.php;
root /tmp/1233;
deny all;
}
虚拟主机配置文件
vim 555.conf
server
{
listen 80;
server_name 555.com;
index index.html index.htm index.php;
root /data/www;
location ~ \.php$ {
include fastcgi_params;
#fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;
}
}
安装LNMP完成后,配置好虚拟主机文件。
登录192.168.1.7 出现403 forbidden提示,怎么也想不出哪里出现的问题。
cat nginx_error.log 没有错误日志
请帮忙!
默认的虚拟主机配置文件。
ls /usr/local/nginx/conf/vhosts/default.conf
server
{
listen 80 default_server;
server_name localhost;
index index.html index.htm index.php;
root /tmp/1233;
deny all;
}
虚拟主机配置文件
vim 555.conf
server
{
listen 80;
server_name 555.com;
index index.html index.htm index.php;
root /data/www;
location ~ \.php$ {
include fastcgi_params;
#fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;
}
}
0
贴图错了,555.com也是一样403.
maria 发表于 2016-7-13 09:22
你的默认主机里面配置了deny all 了,用ip直接访问肯定会有问题。你底下的虚拟主机用的是555.com,你用这个 ...
贴图错了,555.com也是一样403.
0
本帖最后由 maria 于 2016-7-13 10:58 编辑
{:6_137:}你在本机上用curl试一下,看返回的是什么结果,还有你配置的是555.com,你访问的时候用的是www.555.com,实际上你用的还是ip啊,并没有用到你555的配置
56557775 发表于 2016-7-13 10:38
贴图错了,555.com也是一样403.
{:6_137:}你在本机上用curl试一下,看返回的是什么结果,还有你配置的是555.com,你访问的时候用的是www.555.com,实际上你用的还是ip啊,并没有用到你555的配置
0
本帖最后由 56557775 于 2016-7-13 13:52 编辑
配置文件更改为www.555.com之后 502 Bad Gateway提示。
maria 发表于 2016-7-13 10:51
你在本机上用curl试一下,看返回的是什么结果,还有你配置的是555.com,你访问的时候用的是www. ...
配置文件更改为www.555.com之后 502 Bad Gateway提示。
编辑回复