对于菜鸟的问题,我很抱歉,我的Ubuntu很烂。
我刚刚在Ubuntu服务器上安装了nginx:
sudo apt-get update
sudo apt-get -y install nginx
它成功地构建了。我正在尝试更改索引页面,所以我修改了我的/usr/share/nginx/html/index.html
,然后尝试了所有这些:
sudo service nginx stop
sudo service nginx start
sudo service nginx restart
但是,当我在浏览器上刷新根页面时,它仍然显示旧页面。
这是index.html的外观:
我已经检查了我的/etc/nginx/nginx.conf
,但没有发现任何特别的东西。
我能错过什么呢?
发布于 2016-11-16 01:20:43
如果你检查过vhost,你就知道根目录是/var/www/html...
vhost位于/etc/nginx/sites available和/etc/nginx/sites enabled中(sites enabled是symlink)。
发布于 2019-03-30 18:16:01
我之前也遇到过同样的问题,然后在通过将“root”从“server/location”移动到“server”来更新nginx conf之后,它工作得很好。Nginx配置文件:
server {
listen 443 ssl;
server_name localhost;
root /usr/share/nginx/html/rdist;
location /user/ {
proxy_pass http://localhost:9191;
}
location /api/ {
proxy_pass http://localhost:9191;
}
location /auth/ {
proxy_pass http://localhost:9191;
}
location / {
index index.html index.htm;
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
}
https://stackoverflow.com/questions/40615678
复制相似问题