miti.sh/conf/nginx.conf

86 lines
1.8 KiB
Nginx Configuration File

worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 80;
# listen 443 ssl;
include mime.types;
charset utf-8;
default_type text/html;
try_files $uri $uri/ $uri.html =404;
# return `/posts/index.html` from `/posts`
location = /posts {
rewrite ^ /posts/ break;
}
# redirect requests ending in a forward slash
location ~ ^/(.+)/$ {
return 301 /$1;
}
location /css {
expires 1h;
alias css;
}
}
server {
server_name git.miti.sh;
location / {
client_max_body_size 1024M;
proxy_pass http://localhost:3000;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
server_name apps.miti.sh;
root /var/www/sites/apps.miti.sh;
}
server {
# listen 443 ssl;
server_name webdevcat.me;
include mime.types;
charset utf-8;
default_type text/html;
location / {
return 301 http://miti.sh$request_uri;
}
location ~ ^/git/?(.*)$ {
return 301 http://git.miti.sh/ccm/$1;
}
location ~ ^/apps/(.*)$ {
return 301 http://apps.miti.sh/$1;
}
}
server {
server_name git.webdevcat.me;
return 301 http://git.miti.sh$request_uri;
}
server {
server_name apps.webdevcat.me;
return 301 http://apps.miti.sh$request_uri;
}
}