mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
Fix minor typo errors | Change Nginx for Caddy | Consolidate templates in this repo
This commit is contained in:
38
templates/nginx-certbot/nginx/conf/proxy.conf
Normal file
38
templates/nginx-certbot/nginx/conf/proxy.conf
Normal file
@@ -0,0 +1,38 @@
|
||||
# Reverse proxy
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name api.domain.com;
|
||||
server_tokens off;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name api.domain.com;
|
||||
server_tokens off;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/api.domain.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/api.domain.com/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:{LOCAL_NETWORK_PORT}/;
|
||||
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-Host $host;
|
||||
|
||||
# WebSocket support
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
# Change upload max size
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
}
|
||||
29
templates/nginx-certbot/nginx/conf/static.conf
Normal file
29
templates/nginx-certbot/nginx/conf/static.conf
Normal file
@@ -0,0 +1,29 @@
|
||||
# Static delivery
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name test.domain.com;
|
||||
server_tokens off;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name test.domain.com;
|
||||
server_tokens off;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/test.domain.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/test.domain.com/privkey.pem;
|
||||
|
||||
location / {
|
||||
root /var/www/static;
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user