This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* /wp-login\.php|/wp-admin/((?!(admin-ajax\.php|css/|js/)).)*$ { | |
index index.php index.html index.htm; | |
# Basic認証のメッセージ | |
auth_basic "Please enter your ID and password"; | |
# .htpasswd ファイルのパス | |
auth_basic_user_file /etc/nginx/conf.d/.htpasswd; | |
location ~ .*\.php$ { | |
try_files $uri =404; | |
proxy_pass http://backend; | |
} | |
} |
proxy_pass 使用してるんで、これはリバプロ側の設定です。
バックエンド側とか、そもそもリバプロ建てないって時は if ($request_filename ~ .*\.php) { }
の中をよしなに変更してください。
コメントを残す