Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx iikanzi #9

Merged
merged 2 commits into from Sep 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 58 additions & 1 deletion etc/nginx.conf
Expand Up @@ -41,5 +41,62 @@ http {
#gzip on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;

server {
root /home/isucon/isucon10-qualify/webapp/public;
listen 80 default_server;
listen [::]:80 default_server;

if ($http_user_agent ~ ISUCONbot(-Mobile)?) {
return 503;
}

if ($http_user_agent ~* ISUCONbot-Image\/) {
return 503;
}

if ($http_user_agent ~* Mediapartners-ISUCON) {
return 503;
}

if ($http_user_agent ~* ISUCONCoffee) {
return 503;
}

if ($http_user_agent ~* ISUCONFeedSeeker(Beta)?) {
return 503;
}

if ($http_user_agent ~* "crawler \(https:\/\/isucon\.invalid\/(support\/faq\/|help\/jp\/)") {
return 503;
}

if ($http_user_agent ~* isubot) {
return 503;
}

if ($http_user_agent ~* Isupider) {
return 503;
}

if ($http_user_agent ~* Isupider(-image)?) {
return 503;
}

if ($http_user_agent ~* "(bot|crawler|spider)(?:[-_ .\/;@()]|$)/i") {
return 503;
}

location /api {
proxy_pass http://localhost:1323;
}

location /initialize {
proxy_pass http://localhost:1323;
}

location / {
root /www/data;
}
}
}