我的Nginx配置出现问题。
我的/etc/nginx/sites-default/default
如下:
#Subdomain 1 HTTP
server {
listen 80;
server_name .subdomain1.example.com;
location / {
proxy_pass http://localhost:1111;
}
}
#Subdomain 1 HTTPS
server {
listen 443 ssl;
server_name .subdomain1.example.com;
ssl_certificate /etc/ssl/subdomain1/server.crt;
ssl_certificate_key /etc/ssl/subdomain1/server.key;
location / {
proxy_pass http://localhost:1111;
}
}
#Subdomain 2 HTTP
server {
listen 80;
server_name .subdomain2.example.com
location / {
proxy_pass http://localhost:2222;
}
}
#Subdomain 2 HTTPS <-- NOT working
server {
listen 443 ssl;
server_name .subdomain2.example.com;
ssl_certificate /etc/ssl/subdomain2/server.crt;
ssl_certificate_key /etc/ssl/subdomain2/server.key;
location / {
proxy_pass http://localhost:2222;
}
}
第一个路由(HTTP子域1)工作正常。 第二条路由(HTTPS子域1)也有效。 第三条路由(HTTP子域#2)有效。
但是,第四条路线没有。这与第三个实例相同,但配置了SSL以用于HTTPS流量。
您能发现我的错误吗?
谢谢!
修改
为清楚起见:当我说第四条路线不起作用时,我的意思是访问https://subdomain2.example.com超时(504)