Permalink
Fetching contributors…
Cannot retrieve contributors at this time
# prevent non freecodecamp traffic | |
server { | |
# returning 444 here will immediately drop the connection | |
return 444; | |
} | |
# redirect root to www subdomain | |
server { | |
listen 80; | |
server_name freecodecamp.com; | |
return 301 $scheme://www.freecodecamp.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name freecodecamp.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/freecodecamp.com.chained.crt; | |
ssl_certificate_key /etc/nginx/ssl/freecodecamp.key; | |
return 301 $scheme://www.freecodecamp.com$request_uri; | |
} | |
# upgrade ssl | |
server { | |
listen 80; | |
server_name www.freecodecamp.com; | |
return 301 https://www.freecodecamp.com$request_uri; | |
} | |
# ssl | |
server { | |
listen 443 ssl; | |
server_name www.freecodecamp.com; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/freecodecamp.com.chained.crt; | |
ssl_certificate_key /etc/nginx/ssl/freecodecamp.key; | |
# general error | |
error_page 500 501 502 503 /500-oops.html; | |
# when doing planned maintenance | |
# error_page 500 /500-maintenance.html; | |
# When Node servers are timing out | |
error_page 504 /504-overload.html; | |
location = /500-oops.html { | |
root /home/freecodecamp/static; | |
} | |
location = /500-maintenance.html { | |
root /home/freecodecamp/static; | |
} | |
location = /504-overload.html { | |
root /home/freecodecamp/static; | |
} | |
location = /main.css { | |
root /home/freecodecamp/static; | |
} | |
location / { | |
include /etc/nginx/mime.types; | |
proxy_pass http://127.0.0.1:45454; | |
proxy_http_version 1.1; | |
proxy_read_timeout 60; | |
proxy_cache_bypass $http_upgrade; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
# add client's IP to proxy request to upstream node servers | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
# proxy github pages wiki | |
location /fauxwiki { | |
proxy_pass http://freecodecamp.github.io/fauxwiki; | |
proxy_redirect default; | |
proxy_buffering off; | |
proxy_set_header Host freecodecamp.github.io; | |
proxy_set_header X-Host freecodecamp.github.io; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
server { | |
listen 80; | |
server_name webhook.freecodecamp.com; | |
location / { | |
include /etc/nginx/mime.types; | |
proxy_pass <%= prbot ip address %> | |
proxy_http_version 1.1; | |
proxy_read_timeout 60; | |
proxy_cache_bypass $http_upgrade; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
# add client's IP to proxy request to upstream node servers | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
} |