我试图将http重定向到https,我有这个配置:
files:
"/etc/nginx/conf.d/robots.conf":
mode: "000544"
owner: root
group: root
content: |
server {
listen 80;
server_name example.com;
location =/health {
return 200 "health-check";
}
location / {
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
}
}
server {
listen 80 default_server;
server_name www.example.com;
location =/health {
return 200 "health-check";
}
location / {
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
}
}
但是当我转到http://example.com或http://www.example.com时,没有重定向... 我尝试了多种设置,但似乎它从未完全有效。
答案 0 :(得分:0)
执行此操作的最佳方法是将配置设置如下
<form name="test4" action="wp-comments-post.php" method="post" id="commentform4" class="comment-form show_info" data-abide enctype="multipart/form-data">
<input type="file" name="pmg_comment_avatar4" id="avatar-upload" />
..........
</form>
<form name="test5" action="wp-comments-post.php" method="post" id="commentform5" class="comment-form show_info" data-abide enctype="multipart/form-data">
<input type="file" name="pmg_comment_avatar5" id="avatar-upload" />
..........
</form>