location / { root /usr/share/nginx/html; return 301 https://$host/rs; } location /rs/ { proxy_pass http://172.17.0.7:8080/guacamole/; proxy_buffering off; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; access_log off;
# UPSTREAM SERVERSupstream upstream70b4351bbf6548ba827f620ee5b55029 {server 10.1.8.12:8080 weight=1 max_conns=100 max_fails=10 fail_timeout=5;}
# apache htpasswd and htaccess location ~ /\.ht { return 403; } # those files may expose file system stuff location ~ \.DS_Store$ { return 403; } rewrite / /guacamole redirect;location ~* $host/guacamole { DeniedUrl "/waf_denied.html"; if ($scheme != "https") { return 302 https://$host$request_uri; } autoindex off; proxy_set_header Host $host; proxy_pass http://upstream70b4351bbf6548ba827f620ee5b55029;
Websocket support will be in 1.1 (https://github.com/opnsense/plugins/pull/828)
For the location block: it looks very strange to me to include the hostname. Why?
I think it was more convention than anything else. I took the same sort of rules I used for nginx is the standalone instance and one of the cool things is nginx (like apache) can have multiple 'identites' in different config files which can be very handy. So if you are coming in as say mail.host.domain you get the webmaill forwarding, if you come in as dashboard.host.domain you get another service. All the $host does is make sure that the urls stay consistent I think. [/qoute]No your URL for Code: [Select]location ~* $host/guacamole would be: https://mail.host.domain/mail.host.domain/guacamole which is very uncommon and stupid.Quote from: opnonce on September 20, 2018, 11:18:20 amI assume you knew this because you can allow multiple entries to be created though I am still unclear how they are all supposed to work together with the same nginx.conf file. Or maybe I am just misunderstanding how it is all parsed, it was very late last night when I started looking into it going off into the weeds. you probably want a "/guacamole" or "/" location to forward to the upstream which it will reach with the same URL (without pre- or postfix).Quote from: opnonce on September 20, 2018, 11:18:20 amEither way looks like it is shaping up nicely and I don't mind playing around with it on a non-production install and ironing out other edge cases. If you find a normal case, it would be probably good for everyone to know about it.
location ~* $host/guacamole
I assume you knew this because you can allow multiple entries to be created though I am still unclear how they are all supposed to work together with the same nginx.conf file. Or maybe I am just misunderstanding how it is all parsed, it was very late last night when I started looking into it going off into the weeds.
Either way looks like it is shaping up nicely and I don't mind playing around with it on a non-production install and ironing out other edge cases.
location / { SecRulesEnabled; LibInjectionXss; CheckRule "$LIBINJECTION_XSS >= 8" BLOCK; LibInjectionSql; CheckRule "$LIBINJECTION_SQL >= 8" BLOCK; DeniedUrl "/waf_denied.html"; autoindex off; proxy_set_header Host $host; proxy_pass http://upstream16d9678a48cf438b8f71617150c53c4c;}