Created
July 5, 2018 16:32
-
-
Save PalinuroSec/f0bfb815240573ab1b0b58f3c76620d4 to your computer and use it in GitHub Desktop.
nginx settings for mirrorbits server
This file contains hidden or 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 80 default_server; | |
listen [::]:80 default_server; | |
listen 443 ssl default_server; | |
listen [::]:443 ssl default_server; | |
include snippets/snakeoil.conf; | |
root /srv; | |
# Add index.php to the list if you are using PHP | |
index index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location ~ ^/parrot/(?<fwd_path>.*)(?<fwd_file>\.iso|\.img|\.deb|\.udeb|\.dsc|\.gz|\.xz|\.bz2|\.lzma)$ { | |
proxy_pass http://127.0.0.1:8080/$fwd_path$fwd_file; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_buffering off; | |
} | |
location ~ ^/parrot/(?<fwd_path>.*)(\.mirrorlist)$ { | |
proxy_pass http://127.0.0.1:8080/$fwd_path?mirrorlist; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_buffering off; | |
} | |
location ~ ^/parrot/(?<fwd_path>.*)(\.mirrorstats)$ { | |
proxy_pass http://127.0.0.1:8080/$fwd_path?mirrorstats; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_buffering off; | |
} | |
location / { | |
root /srv; | |
try_files $uri $uri/ =404; | |
autoindex on; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment