nginx - 我的站点无法正常工作,甚至在站点可用默认值中添加了构建路径
问题描述
我在 AWS Ngnix 上添加了我的网站。我已经构建了一个应用程序并在 /etc/ngnix/sites-available/default 中添加了该路径,但是在访问 IP 地址后它说找不到 404。
我构建了一个应用程序并在站点可用/默认中提供了该路径
以下是我的网站的代码 - 可用/默认
GNU nano 2.9.3 /etc/nginx/sites-available/default
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
# root /var/www/html;
root /var/www/sample/dist/sample;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri /index.html index.php;
}
# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
解决方案
推荐阅读
- python - 如何指示这些简单的模块依次运行?
- php - PHP 解析错误:语法错误,意外的 'DB_USER' (T_STRING),在第 26 行的 /var/www/wordpress/wp-config.php 中需要 ',' 或 ')'
- javascript - 调整大小以扩展和最小化 div
- javascript - 是否可以查看基于 firebase 密码的帐户的密码?
- java - 如何过滤firebase中的嵌套数据?
- python-3.6 - 错误:db 类型为 dbm.gnu,但该模块在 windows 中不可用
- javascript - 如何知道我的 gps 朝哪个方向前进?
- c# - 如何关闭标签页?
- r - dplyr 计算某些文本
- python - Python将redis对象转换为原始数据类型