Can someone give some help into what should be a proper nginx/nopcommerce configuration with proper SSL.
Currently I have this in my nginx config for default site:
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /path_to_certificate_chain.crt;
ssl_certificate_key /path_to_key.key;
ssl_session_timeout 1d;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling off;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
server_name myshop.com;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
I have changed UseHttpXForwardedProto and UseHttpClusterHttps to true in appsettings.json.
The SSL is properly installed for the domain, but I cannot seem to have it working with nop. Best I accomplished is to front store loads over https but then I can't access /Admin part.
Also, I updated throuh db the Store settings, since I cannot access it through web, but doesn't seem to help.
mysql> SELECT Name, Url, Hosts, SslEnabled from Store;
+--------+-------------------+-----------+------------+
| Name | Url | Hosts | SslEnabled |
+--------+-------------------+-----------+------------+
| M-Shop | https://myshop.com | myshop.com | 1 |
+--------+-------------------+-----------+------------+
Any help is appriciated.