nginx conf

This commit is contained in:
MaelREBOUX 2021-03-29 23:44:36 +02:00
parent dc494592f9
commit 049f9303a0
2 changed files with 96 additions and 0 deletions

44
nginx/conf_nginx Normal file
View file

@ -0,0 +1,44 @@
#-----------------------------------------------------------------------
# ar-redadeg.openstreetmap.bzh
#-----------------------------------------------------------------------
server {
server_name ar-redadeg.openstreetmap.bzh;
access_log /var/log/nginx/bzh_openstreetmap_ar_redadeg_access.log combined;
error_log /var/log/nginx/bzh_openstreetmap_ar_redadeg_error.log;
# global
autoindex on;
index index.html;
location / {
root /data/projets/ar_redadeg/www/;
}
location /mviewer/ {
alias /data/projets/mviewer/;
}
location ~/2021/(.*)$ {
alias /data/projets/ar_redadeg/data/2021/$1 ;
}
location ~/2022/(.*)$ {
alias /data/projets/ar_redadeg/data/2022/$1 ;
}
# geoserver reverse proxy vers tomcat
location /geoserver/ {
proxy_pass http://localhost:8080/geoserver/;
proxy_ignore_client_abort on;
}
location /mviewer/ {
alias /data/projets/mviewer/;
}
}

View file

@ -0,0 +1,52 @@
#-----------------------------------------------------------------------
# *.openstreetmap.bzh
#-----------------------------------------------------------------------
server {
listen 80;
listen [::]:80;
server_name *.openstreetmap.bzh;
location / {
access_log off;
proxy_pass http://bed110:80/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# CORS
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';
}
}