次のように、同じホストに http:// と https:// があります。
server {
listen 80;
listen 443 ssl;
...
...
}
私がする必要があるのは、私のショップにアクセスするユーザーを https:// にリダイレクトすることです。問題は、私が多くの言語を持っていることです:
https://mydomain.com/ en /shop https://mydomain.com/ fr /shop など...
私はこれを試しましたが、うまくいきませんでした(nginx: configuration file /etc/nginx/nginx.conf test failed)
:
if ($server_port = 80) {
location (en|fr)/shop {
rewrite ^ https://$host$request_uri permanent;
}
}