I have http:// and https:// on the same host like the following:
server {
listen 80;
listen 443 ssl;
...
...
}
What I need to do is redirecting users who access my shop to https://. The problem is I have many languages:
https://example.com/en/shophttps://example.com/fr/shop- etc...
I tried this and it didn't work (nginx: configuration file /etc/nginx/nginx.conf test failed):
if ($server_port = 80) {
location (en|fr)/shop {
rewrite ^ https://$host$request_uri permanent;
}
}