Good day everybody,
I have set up an Nginx Webserver on an Ubuntu instance. I have configured the /etc/nginx/sites-enabled/default file like this:
server {
listen 80; #listen IPv4
listen [::]:80; #listen IPv6
server_name my.domain.de;
return 301 https://$host$request_uri; #redirect to https://
}
server {
listen 443 ssl spdy; #listen IPv4
listen [::]:443 ssl spdy; #listen IPv6
error_log /var/log/nginx/rocketchat_error.log;
ssl_certificate /etc/letsencrypt/live/my.domain.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my.domain.de/privkey.pem; # managed by Certbot
ssl_dhparam /etc/nginx/dhparams.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESG$
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 180m;
location / {
proxy_pass http://my.domain.de:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}
I have also included the /etc/nginx/sites-enabled/default file inside /etc/nginx/nginx.conf under http{} via
include /etc/nginx/sites-enabled/default;
I also tried to it with
rewrite ^ https://$host$request_uri? permanent;
and with
retrun 301 https://my.domain.de$request_uri;
and any other possible variant.
Any help would be appreciated.
Thanks in advance
Simon
301 Moved Permanently
* Connection #0 to host my.domain.de left intact * Rebuilt URL to: 3000/ * Hostname was NOT found in DNS cache * Trying 0.0.11.184... * Immediate connect fail for 0.0.11.184: Invalid argument * Closing connection 1 curl: (7) Couldn't connect to server
– drflngr Sep 01 '17 at 08:10