mirror of
https://github.com/KevinMidboe/nginx.git
synced 2025-10-29 01:30:27 +00:00
64 lines
2.3 KiB
Plaintext
64 lines
2.3 KiB
Plaintext
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name kibana.kevinmidboe.com;
|
|
|
|
location / {
|
|
|
|
proxy_pass http://10.0.0.115:5601;
|
|
}
|
|
|
|
ssl_certificate /etc/letsencrypt/live/kibana.kevinmidboe.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/kibana.kevinmidboe.com/privkey.pem; # managed by Certbot
|
|
}
|
|
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name elastic.kevinmidboe.com;
|
|
|
|
location / {
|
|
add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com';
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'Content-Type, Content-Length';
|
|
add_header 'Content-Type' 'application/json; charset=utf-8';
|
|
add_header 'Content-Length' 0;
|
|
return 204;
|
|
}
|
|
|
|
if ($request_method = 'GET') {
|
|
add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com';
|
|
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 = 'POST') {
|
|
add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com';
|
|
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';
|
|
}
|
|
|
|
proxy_pass http://10.0.0.115:9301;
|
|
}
|
|
|
|
ssl_certificate /etc/letsencrypt/live/elastic.kevinmidboe.com/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/elastic.kevinmidboe.com/privkey.pem; # managed by Certbot
|
|
}
|