马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
nginx 部署多个 flask 项目时, 如果直接用IP地址 , 项目能正常的运行;
但是如果是配置域名的话, 就出现了无法访问;
求各路大神支支招;
下面是nginx配置文件;~!server {
listen 9001 default_server;
listen [::]:9001 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://localhost:9090;
proxy_redirect off;
proxy_set_header Host $http_post;
proxy_set_header X-Real-IP $remote_addr;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name zhl6688.com.cn www.zhl6688.com.cn;
#server_name _;
root /usr/share/nginx/html;
return 301 https://zhl6688.com.cn$request_uri;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://localhost:5000;
proxy_redirect off;
proxy_set_header Host $http_post;
proxy_set_header X-Real-IP $remote_addr;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 443 ssl;
server_name zhl6688.com.cn www.zhl6688.com.cn;
root /home/web/WechatApps;
ssl_certificate /home/web/WechatApps/ssl/zhl6688.com.cn_bundle.crt;
ssl_certificate_key /home/web/WechatApps/ssl/zhl6688.com.cn.key;
}
|