问题是我无法使用https://www.gogogo.com:8888打开网站;并且没有端口号和https都可以正常工作。当我在safari上的google上搜索名称时,第一个结果将自动转到https://www.gogogo.com:8888,该名称不起作用,但是当我使用chrome并单击相同的链接时。 https://www.gogogo.com可以打开。
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name www.gogogo.com:8888;
root /usr/share/nginx/html;
return 301 https://www.gogogo.com$request_uri;
}
server{
listen 8888;
listen [::]:8888;
return 301 https://www.gogogo.com $request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.gogogo.com:8888;
root /usr/share/nginx/html;
ssl on;
ssl_certificate "/etc/ssl/www.gogogo.com-bundle.crt";
ssl_certificate_key "/etc/ssl/www.gogogo.com.key";
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1h;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security max-age=31536000;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8888;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}