我在sites-enabled
和sites-available
的名为“ findernext-ssl.conf”的文件中添加了以下服务器配置:
server {
listen 443 ssl;
listen [::]:443 ssl ;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name findernext.inventivedesign.fr;
# Redirect all non-SSL traffic to SSL.
if ($ssl_protocol = "") {
rewrite ^ https://$host$request_uri? permanent;
}
location / {
proxy_pass http://127.0.0.1:8084/finder/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header Connection 'Upgrade';
# timeout 43200000;
# websocket_connect_timeout 43200000;
proxy_connect_timeout 43200000;
# so_keepalive on;
tcp_nodelay on;
# websocket_pass websockets;
# websocket_buffer 1k;
}
}
sudo nginx -t
未显示任何解析错误。但是随后重新启动nginx之后,根本无法访问该站点。没有nginx错误,只是找不到。
我实际上只是克隆了另一个名为“ physio-ssl.conf”的文件,该文件有效,并且仅在不同的子域和重定向下看起来完全相同:
server {
listen 443 ssl;
listen [::]:443 ssl ;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name physisolve.inventivedesign.fr;
# Redirect all non-SSL traffic to SSL.
if ($ssl_protocol = "") {
rewrite ^ https://$host$request_uri? permanent;
}
location / {
proxy_pass http://127.0.0.1:8084/physisolve/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header Connection 'Upgrade';
# timeout 43200000;
# websocket_connect_timeout 43200000;
proxy_connect_timeout 43200000;
# so_keepalive on;
tcp_nodelay on;
# websocket_pass websockets;
# websocket_buffer 1k;
}
}
这是怎么回事?谢谢。