我已经使用 uwsgi 设置了一个 nginx Web 服务器来托管我的 Flask 应用程序。当我通过 LAN ip (192.168.1.x) 访问它时,我得到的网站很好,但是当我通过我的公共 IP 访问它时,我收到“404 Not Found nginx/1.14.0 (Ubuntu)”。为什么是这样?我该如何修复它?
/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers …
Run Code Online (Sandbox Code Playgroud)