【发布时间】:2013-08-30 00:45:40
【问题描述】:
我在同一主机上有 http:// 和 https://,如下所示:
server {
listen 80;
listen 443 ssl;
...
...
}
我需要做的是将访问我商店的用户重定向到 https://。问题是我有多种语言:
https://mydomain.com/zh/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;
}
}
【问题讨论】:
标签: nginx