Skip to content

Instantly share code, notes, and snippets.

@arselzer
Last active August 29, 2015 13:57
Show Gist options
  • Save arselzer/9390287 to your computer and use it in GitHub Desktop.
Save arselzer/9390287 to your computer and use it in GitHub Desktop.
My nginx configuration
server_names_hash_bucket_size 128;
server {
listen 80;
server_name old.alexselzer.com;
client_max_body_size 30M;
location / {
root /var/www;
index index.php index.html index.htm;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param PATH_TRANSLATED /var/www/$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name citationer.org www.citationer.org;
location / {
proxy_pass http://127.0.0.1:8224;
}
}
server {
listen 80;
server_name api.alexselzer.com;
location /random {
proxy_pass http://127.0.0.1:8898;
}
location /pi {
proxy_pass http://127.0.0.1:8999;
}
}
server {
listen 80;
server_name api.3.1415.sexy;
location /pi {
proxy_pass http://127.0.0.1:8999;
}
}
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
server_name new.alexselzer.com alexselzer.com www.alexselzer.com nocdn.alexselzer.com;
client_max_body_size 20M;
# location ~ /assets {
# rewrite ^ http://dur1oexpkcn18.cloudfront.net$request_uri permanent;
# }
location / {
if ($args ~* "^p=\d+") {
return 301 http://old.alexselzer.com$request_uri;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location /random {
return 301 http://api.alexselzer.com$request_uri;
}
location /pi {
return 301 http://api.alexselzer.com$request_uri;
}
location ~ ^/\?p=\d+ {
return 301 http://old.alexselzer.com$request_uri;
}
}
server {
listen 80;
server_name tt.alexselzer.com;
location / {
root /srv/tt;
try_files $uri /timetable.jpg;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment