Last active
April 30, 2024 11:08
-
-
Save amanjuman/a809c618de9e2dd0f9df056806fc1604 to your computer and use it in GitHub Desktop.
UrBackup Nginx Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
# Listen | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
# Server Name and Alias | |
server_name urbackup.example.com; | |
# HTTP to HTTPS redirection | |
if ($scheme != "https") | |
{ | |
return 301 https://$host$request_uri; | |
} | |
# SSL | |
ssl_certificate /etc/letsencrypt/live/urbackup.example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/urbackup.example.com/privkey.pem; | |
# UrBackup Upsteam | |
location / | |
{ | |
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; | |
# Fix the “It appears that your reverse proxy set up is broken" error. | |
proxy_pass http://localhost:55414; | |
proxy_read_timeout 90; | |
proxy_redirect http://localhost:55414 https://urbackup.example.com; | |
} | |
# Robot Text Logging Off | |
location = /robots.txt | |
{ | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
# Fav ICON Disable | |
location = /favicon.ico | |
{ | |
log_not_found off; | |
access_log off; | |
expires max; | |
} | |
# Disable Hidden FIle Access Except Lets Encrypt Verification | |
location ~ /\.well-known | |
{ | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
# Nginx Logging | |
access_log /var/log/nginx/urbackup.example.com-access.log; | |
error_log /var/log/nginx/urbackup.example.com-error.log warn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment