monero-site/_config/nginx.conf
2020-10-30 15:32:01 +01:00

233 lines
6.4 KiB
Nginx Configuration File

# This is included as an example of a config file that works for the site.
# This is important so that anyone can re-host it in the event of something going wrong with the main site.
# The main takeaways from this config file are the redirects.
server {
listen 8080;
server_name downloads.getmonero.org dlsrc.getmonero.org updates.getmonero.org updates.monero.mu dlsrc.monero.mu downloads.monero.mu downloads.monero.cc;
root /var/www/html;
index index.php index.html index.htm;
access_log /var/log/downloads_access.log;
error_log /var/log/downloads_error.log warn;
error_page 403 = 404;
# Disable logging for favicon
location = /favicon.ico {
log_not_found off;
access_log off;
}
# Disable logging for robots.txt
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(ico|css|js|gif|jpe?g|png)$
{
expires 31536000s;
access_log off;
log_not_found off;
add_header Pragma public;
add_header Cache-Control "max-age=31536000, public";
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Downloads!
location /win64 {
rewrite ^ https://$server_name/cli/monero-win-x64-v0.17.1.1.zip redirect;
}
location /win32 {
rewrite ^ https://$server_name/cli/monero-win-x86-v0.17.1.1.zip redirect;
}
location /mac64 {
rewrite ^ https://$server_name/cli/monero-mac-x64-v0.17.1.1.tar.bz2 redirect;
}
location /linux64 {
rewrite ^ https://$server_name/cli/monero-linux-x64-v0.17.1.1.tar.bz2 redirect;
}
location /linux32 {
rewrite ^ https://$server_name/cli/monero-linux-x86-v0.17.1.1.tar.bz2 redirect;
}
location /linuxarm7 {
rewrite ^ https://$server_name/cli/monero-linux-armv7-v0.17.1.1.tar.bz2 redirect;
}
location /linuxarm8 {
rewrite ^ https://$server_name/cli/monero-linux-armv8-v0.17.1.1.tar.bz2 redirect;
}
location /androidarm7 {
rewrite ^ https://$server_name/cli/monero-android-armv7-v0.17.1.1.tar.bz2 redirect;
}
location /androidarm8 {
rewrite ^ https://$server_name/cli/monero-android-armv8-v0.17.1.1.tar.bz2 redirect;
}
location /freebsd64 {
rewrite ^ https://$server_name/cli/monero-freebsd-x64-v0.17.1.1.tar.bz2 redirect;
}
# GUI downloads
location /gui/win64install {
rewrite ^ https://$server_name/gui/monero-gui-install-win-x64-v0.17.1.1.exe redirect;
}
location /gui/win64 {
rewrite ^ https://$server_name/gui/monero-gui-win-x64-v0.17.1.1.zip redirect;
}
location /gui/mac64 {
rewrite ^ https://$server_name/gui/monero-gui-mac-x64-v0.17.1.1.dmg redirect;
}
location /gui/linux64 {
rewrite ^ https://$server_name/gui/monero-gui-linux-x64-v0.17.1.1.tar.bz2 redirect;
}
# Other download redirects
location /cli/win64 {
rewrite ^ https://$server_name/win64 permanent;
}
location /cli/win32 {
rewrite ^ https://$server_name/win32 permanent;
}
location /cli/mac64 {
rewrite ^ https://$server_name/mac64 permanent;
}
location /cli/linux64 {
rewrite ^ https://$server_name/linux64 permanent;
}
location /cli/linux32 {
rewrite ^ https://$server_name/linux32 permanent;
}
location /cli/linuxarm7 {
rewrite ^ https://$server_name/linuxarm7 permanent;
}
location /cli/linuxarm8 {
rewrite ^ https://$server_name/linuxarm8 permanent;
}
location /cli/androidarm7 {
rewrite ^ https://$server_name/androidarm7 permanent;
}
location /cli/androidarm8 {
rewrite ^ https://$server_name/androidarm8 permanent;
}
location /cli/freebsd64 {
rewrite ^ https://$server_name/freebsd64 permanent;
}
location /cli/dragonflybsd64 {
rewrite ^ https://$server_name/dragonflybsd64 permanent;
}
location /win {
rewrite ^ https://$server_name/win64 permanent;
}
location /mac {
rewrite ^ https://$server_name/mac64 permanent;
}
location /linux {
rewrite ^ https://$server_name/linux64 permanent;
}
location /freebsd {
rewrite ^ https://$server_name/freebsd64 permanent;
}
location /dragonflybsd {
rewrite ^ https://$server_name/dragonflybsd64 permanent;
}
location /arm {
rewrite ^ https://$server_name/linuxarm7 permanent;
}
location /arm64 {
rewrite ^ https://$server_name/linuxarm8 permanent;
}
location /arm7 {
rewrite ^ https://$server_name/linuxarm7 permanent;
}
location /arm8 {
rewrite ^ https://$server_name/linuxarm8 permanent;
}
location /monero.win.x64.latest.zip {
rewrite ^ https://$server_name/win64 permanent;
}
location /monero.win.x32.latest.zip {
rewrite ^ https://$server_name/win32 permanent;
}
location /monero.mac.x64.latest.tar.bz2 {
rewrite ^ https://$server_name/mac64 permanent;
}
location /monero.linux.x64.latest.tar.bz2 {
rewrite ^ https://$server_name/linux64 permanent;
}
location /monero.linux.x86.latest.tar.bz2 {
rewrite ^ https://$server_name/linux86 permanent;
}
location /monero.linux.arm7.latest.tar.bz2 {
rewrite ^ https://$server_name/linuxarm7 permanent;
}
location /monero.linux.arm8.latest.tar.bz2 {
rewrite ^ https://$server_name/linuxarm8 permanent;
}
location /monero.freebsd.x64.latest.tar.bz2 {
rewrite ^ https://$server_name/freebsd64 permanent;
}
location /monero.dragonflybsd.x64.latest.tar.bz2 {
rewrite ^ https://$server_name/dragonflybsd64 permanent;
}
location / {
# try_files $uri $uri/ $uri.php $uri.htm $uri.html =404;
index index.html index.htm index.php;
# post_action @download_complete;
}
# location @download_complete {
# resolver 8.8.8.8;
# proxy_pass http://statcounter.monero.cc/stat_counter.php?zz=yy&status=$request_completion&uri=$uri&remote_addr=$remote_addr&http_x_forwarded_for=$http_x_forwarded_for&body_bytes_sent=$body_bytes_sent&request_time=$request_time&scheme=$scheme&server_name=$server_name&http_user_agent=$http_user_agent;
# internal;
# }
}