【问题标题】:Make the keystone supported website live on DigitalOcean让 Keystone 支持的网站在 DigitalOcean 上上线
【发布时间】:2018-08-07 03:26:28
【问题描述】:

这是我的服务器块 nginx 配置,但我不知道是什么错误。当我点击我的域名时,它给了我“404 Not Found”。 请帮忙

服务器{

listen 80;
listen [::]:80;
root /var/www/squareeducation.in/SE_WebApp/template/views/layouts;
index index.html index.htm index.nginx-debian.html default.hbs;
server_name www.squareeducation.in;

location / {
        try_files $uri $uri.hbs/ =404;
        proxy_pass 'http://127.0.0.1:3000';
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_cache_bypass $http_upgrade;
}

 location ~ .*\.(img|gif|jpg|jpeg|png|bmp|swf|js|css)$ {
        root /var/www/squareeducation.in/SE_WebApp/public;
        try_files $uri $uri/ =404;
}

}

【问题讨论】:

    标签: digital-ocean keystonejs


    【解决方案1】:

    这意味着您的服务器找不到文件所在的位置,另外,我不知道您的配置,但如果您开始简单,您可以尝试使用:

    listen 80;
    listen [::]:80;
    root /var/www/squareeducation.in;
    index index.html index.htm index.nginx-debian.html default.hbs;
    server_name www.squareeducation.in squareeducation.in;
    
    location / {
            try_files $uri $uri.hbs/ =404;
    }
    
    }
    

    我个人总是从简单的东西开始进行故障排除。在该路由上放置一个基本的 index.html 文件:/var/www/squareeducation.in

    并查看它是否读取它,同时应用权限:sudo chmod 775 /var/www/squareeducation.in

    这是一个包含 Nginx 基本命令的页面,它会派上用场:

    https://elkepon.com/how-to-install-nginx-on-ubuntu-16-04/

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2016-03-23
      • 2012-06-16
      • 1970-01-01
      • 1970-01-01
      • 2017-04-09
      • 2012-08-04
      • 1970-01-01
      • 2012-07-07
      • 2021-11-21
      相关资源
      最近更新 更多