× [PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。 |
起動コマンド
/etc/init.d/nginx start /etc/nginx/sites-enable/以下 upstream appserver { server localhost:3000; } geo $allowed { default no; 202.32.47.0/24 yes; 219.163.197.64/27 yes; 221.186.216.16/29 yes; 202.143.92.128/26 yes; 61.197.167.128/28 yes; 122.208.122.144/29 yes; 10.0.0.0/8 yes; 122.132.171.175 yes; 219.109.218.130 yes; 210.122.209.56 yes; 210.122.209.124 yes; 210.122.209.230 yes; } server { listen 80; server_name otani1.bnr.bng.jp; location / { try_files $uri @proxy_to_appserver; } location @proxy_to_appserver { if ($allowed = no) { return 403; } access_log /var/log/nginx/otani1.bnr.bng.jp.access.log; error_log /var/log/nginx/otani1.bnr.bng.jp.error.log; proxy_pass http://appserver; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } PR |
|