So I’ve found that a couple people got theirs to work behind nginx and apache. How would I translate the following into the Caddyfile?
Apache user:
If someone tries to setup apache mod_proxy with Shinobi: I found the following apache2.4 config to work:
ProxyRequests OnProxyPass /socket.io/ ws://localhost:8080/socket.io/ ProxyPassReverse /socket.io/ ws://localhost:8080/socket.io/ ProxyPass "/" "http://localhost:8080/" ProxyPassReverse "/" "http://localhost:8080/"
nginx user 1:
server { listen 443 ssl; server_name my.domain; ssl_certificate /config/keys/letsencrypt/fullchain.pem; ssl_certificate_key /config/keys/letsencrypt/privkey.pem; ssl_dhparam /config/nginx/dhparams.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers removed ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0 ssl_session_cache shared:SSL:10m; ssl_session_tickets off; # Requires nginx >= 1.5.9 ssl_stapling on; # Requires nginx >= 1.3.7 ssl_stapling_verify on; # Requires nginx => 1.3.7 add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; location / { proxy_pass http://10.0.0.10:8083/; proxy_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; } }
nginx user 2:
Hey all, just wanted to share a solution to a problem I was having that led me here. I had the same issue as @alistek with getting Shinobi to render behind nginix. It would work just fine when hitting it on the local server directly but using a reverse proxy caused the browser to render the html as text. The fix was to add “add_header X-Frame-Options “SAMEORIGIN”;” to the nginx config. So my final nginx config for shinobi looks like this:
location / { try_files $uri/ @nodejs; } location @nodejs { add_header X-Frame-Options "SAMEORIGIN"; proxy_pass http://<host>:<port>; 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;