Last active
April 3, 2020 10:44
-
-
Save lazyfrosch/7fe8319ce3288636713529f9f7a67886 to your computer and use it in GitHub Desktop.
Icinga2 proxy through Nginx
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html; | |
index index.html; | |
server_name icinga.example.com; | |
location ~ ^/icinga2 { | |
return 301 https://$server_name$request_uri; | |
} | |
# any other config | |
} | |
server { | |
listen 443 ssl default_server; | |
listen [::]:443 ssl default_server; | |
ssl_certificate /etc/nginx/certs/icinga.example.com.full.crt; | |
ssl_certificate_key /etc/nginx/certs/icinga.example.com.key; | |
root /var/www/html; | |
index index.html; | |
server_name icinga.example.com; | |
location = /icinga2 { | |
return 301 /icinga2/; | |
} | |
location /icinga2/ { | |
proxy_pass https://127.0.0.1:5665/; | |
proxy_ssl_trusted_certificate /var/lib/icinga2/certs/ca.crt; | |
proxy_http_version 1.1; | |
include proxy_params; | |
} | |
# any other config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment