Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nginx settings for mirrorbits server
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