-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# | ||
# Firmware Mirror configuration | ||
# | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
# | ||
# SSL configuration | ||
# | ||
#listen 443 ssl; | ||
#listen [::]:443 ssl; | ||
#ssl_certificate | ||
#ssl_certificate_key | ||
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
# ssl_ciphers HIGH:!aNULL:!MD5; | ||
|
||
root /mnt/firmware; | ||
|
||
index index.html index.htm index.nginx-debian.html; | ||
|
||
server_name firmware.freifunk-suedholstein.de firmware.ffshev.de fw.ffshev.de; | ||
|
||
location / { | ||
try_files $uri $uri/ =404; | ||
autoindex on; | ||
|
||
# | ||
# Wide-open CORS config for nginx | ||
# | ||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | ||
# | ||
# Custom headers and headers various browsers *should* be OK with but aren't | ||
# | ||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; | ||
# | ||
# Tell client that this pre-flight info is valid for 20 days | ||
# | ||
add_header 'Access-Control-Max-Age' 1728000; | ||
add_header 'Content-Type' 'text/plain; charset=utf-8'; | ||
add_header 'Content-Length' 0; | ||
return 204; | ||
} | ||
|
||
if ($request_method = 'POST') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; | ||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; | ||
} | ||
if ($request_method = 'GET') { | ||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | ||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; | ||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; | ||
} | ||
} | ||
} |
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