Skip to content

Instantly share code, notes, and snippets.

@davehorton
Created January 8, 2023 21:12
Show Gist options
  • Save davehorton/bd35eafe1e0ad6467e417630f020a533 to your computer and use it in GitHub Desktop.
Save davehorton/bd35eafe1e0ad6467e417630f020a533 to your computer and use it in GitHub Desktop.
example nginx config for jambonz using https
# more /etc/nginx/sites-available/default
server {
server_name jambonz.net;
location /api/ {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://localhost:3002;
proxy_set_header Host $host;
}
location / {
proxy_pass http://localhost:3001;
proxy_set_header Host $host;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/jambonz.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jambonz.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name grafana.jambonz.net;
location / {
proxy_pass http://localhost:3010;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/grafana.jambonz.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/grafana.jambonz.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name homer.jambonz.net;
location / {
proxy_pass http://localhost:9080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/grafana.jambonz.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/grafana.jambonz.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name jaeger.jambonz.net;
location / {
proxy_pass http://localhost:16686;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/grafana.jambonz.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/grafana.jambonz.net/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = grafana.jambonz.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name grafana.jambonz.net;
return 404; # managed by Certbot
}
server {
if ($host = homer.jambonz.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name homer.jambonz.net;
return 404; # managed by Certbot
}
server {
if ($host = jaeger.jambonz.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name jaeger.jambonz.net;
return 404; # managed by Certbot
}
server {
if ($host = jambonz.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name jambonz.net;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment