私はどんなユーザータイプでhttps://example.comへのすべてのトラフィックをリダイレクトしないようにしようとしています。すべてのトラフィックをhttpsにリダイレクトします。 nginxの
を次の.confファイルは非常に近いですが、それはhttp://example.com
あなたは私が変更すること何を示唆しているをキャッチしていませんすべてのトラフィックがhttps://example.comにリダイレクトされるようにするにはどうすればよいですか?
ありがとうございます。
server {
listen 80;
listen 443;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
server_name example.com;
access_log /var/log/nginx/example-access.log;
error_log /var/log/nginx/example-error.log;
root /var/www/html/web;
index index.html index.htm index.php;
location/{
try_files $uri $uri/ /index.php$uri?$args;
}
rewrite ^/backend\.php/?(.*)$ /$1 permanent;
location /admin {
index admin content backend.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /backend.php/$1 last;
}
location ~ "^(.+\.php)($|/)" {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
}
は、サイトを完全に削除します。重複するserver_nameがあると文句を言う – smugford
申し訳ありませんが、サイトを完全にダウンさせています。 – smugford
'sudo nginx -t'は何の出力ですか? – ollpu