Nginx reverse proxy configuration

Géza Búza edited this page Nov 16, 2016 · 2 revisions

This guide intended to be used for Huginn running in Docker. If you don't use Docker or want a more customised configuration, see the sample configuration in the application repository at


The settings below configures Nginx as a reverse proxy with the following assumptions:

  • Huginn is running on machine with IP and listens on port 3000
  • Application is available only over HTTPS protocol and FORCE_SSL is set to true in Huginn configuration
  • Public domain name for the application is
server {
    # Make it available from the Internet
    allow all;

    listen 80;

    # server names for this server.
    # any requests that come in that match any these names will use the proxy.
    access_log /var/log/nginx/;
    error_log /var/log/nginx/;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;

    listen 443 ssl;

    # Setup SSL certificate with Let's Encript (
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_trusted_certificate /etc/letsencrypt/live/;
    ssl_stapling on;
    ssl_stapling_verify on;

    if ($scheme != "https") {
        return 301 https://$host$request_uri;
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.