我已经创建了一个windows amazon ec2示例并在其上安装了一个flask应用程序。localhost打开了所需的主页。然后使用waitress-serve托管app.py文件,并使用nsm创建了一个服务。之后,我下载并执行了nginx.exe。现在我的ec2公共ip显示了nginx主页。修改nginx.conf后我希望看到的是主页而不是nginx主页,但我仍然看到了nginx主页。以下是我的nginx.conf文件文本
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
#include /etc/nginx/sites-enabled/*;
#include mime.types;
#default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
#sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream flaskhelloworld {
server 127.0.0.1:5000;
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
server {
listen 80 default_server;
server_name my_public_ip;
listen [::]:80 default_server;
root /var/www/html;
server_name _;
location / {
proxy_pass http://flaskhelloworld;
}
}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
1条答案
按热度按时间o8x7eapl1#
检查删除浏览器该高速缓存或在私人标签页中打开。