Comments (19)
So are you looking to run Webmin under Nginx, instead of Apache or the built-in webserver?
from webmin.
Correct. I've setup Apache to reverse proxy Webmin before without issues so I only have one SSL cert/web server to manage. In setting up a new server last night I decided to use nginx as I don't need the heavy lifting of Apache.
Most things are working fine, but the proc module was the first thing I noticed that didn't work and after working with Webmin a bit further many of the redirects back to a module page after submitting data fail the redirect, but work otherwise. Example: Create a new user, enter details, hit submit -- user is successfully created but the redirect back to the main user management module fails.
from webmin.
Oh, so you only have Nginx proxying to Webmin? Or is Nginx running the Webmin CGIs directly?
I recommend the proxy approach, and in a virtual host instead of a sub-directory.
from webmin.
Only as a proxy. I think I have narrowed down things some but still don't fully understand what isn't working here, but changing Webmin's redirects from "Protocol, host, port and path" to "Path only" now has nginx returning 501 errors in some places (saving a user modificaton) and simply doing nothing at all in others (trying to access the proc module).
Previously the redirects would fail, so seeing 501 errors is something new. Here is the actual error from the nginx logs:
[error] 2513#0: *120 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: xxx.xxx.xxx.81, server: my.server, request: "GET /useradmin/index.cgi?mode=users HTTP/1.1", host: "xxx.xxx.xxx.19", referrer: "https://xxx.xxx.xxx.19/webmin/useradmin/edit_user.cgi?user=myuser"
More searching; found someone else having pretty much the same difficulty and probably explains it a bit better: http://witlogs.com/Questions/143022/Proxying-webmin-with-nginx
from webmin.
Does the nginx proxy also re-write Location: headers (which are used for redirects)? Apache does this, via the ProxyPassReverse directive, which has to be set in addition to ProxyPass. Maybe Nginx needs something similar?
from webmin.
It does not by default, but there are settings to enable this (which I have enabled).
See: http://wiki.nginx.org/LikeApache
My own settings are
server {
listen 443;
server_name my.fqdn;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
root /usr/share/nginx/www;
index index.html index.htm;
location /webmin/ {
include conf.d/proxy.conf;
proxy_pass http://127.0.0.1:10000/;
}
}
and the contents of conf.d/proxy.conf
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
By everything I've seen it should work without issues...But does not. While scouring Google I did see some mention that Webmin uses non-relative paths for pages in some locations? Not sure if that is correct or not, but it would explain why some modules are behaving a bit differently than others.
from webmin.
Do you have the line relative_redir=1 in your /etc/webmin/config file? That should force use of a relative redirects.
from webmin.
Actually, you are right that the proc module uses an absolute redirect in some cases - I'll fix that.
from webmin.
I do not have relative_redir=1 in my config as I didn't know about it. I had tried webroot without any luck though. I'll give it a spin when I get home today and report back.
from webmin.
Added relative_redir=1 and your fix for the proc module; no change in status.
from webmin.
I'm not sure what is going on here, sorry.
Are you proxying a sub-directory of your website to Webmin, or does it have its own virtual host?
from webmin.
It is being proxied as a sub-directory. I installed with the .deb hosted from your site and am trying to proxy https://my.website.com/webmin to http://localhost:10000
from webmin.
Do you have the line webprefix=/webmin in your /etc/webmin/config file?
from webmin.
Yes, I do.
On Thu, May 15, 2014 at 11:21 PM, Jamie Cameron [email protected]:
Do you have the line webprefix=/webmin in your /etc/webmin/config file?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/146#issuecomment-43295448
.
from webmin.
I'm out of ideas here, sorry .. this seems more like an Nginx issue.
from webmin.
@Kline- you will need to do some rewriting in nginx for this. For TextDrive I had to remove the trailing hostname out of the URL's when reverse proxying webmin but we were using a load balancer that allowed us to remove the prefix from the URL's.
from webmin.
Fair enough, and it may entirely be. There doesn't seem to be a lot of information out there for getting Webmin working behind nginx yet (and I'm new to nginx myself).
Getting CherryPy apps to run behind nginx has been as simple as Apache though. I'm not a Perl person at all and even less knowledgeable about writing a web server implemented in Perl, so I won't try to take any guesses at the differences between CherryPy and Miniserv :)
Thanks for all your help! As it sits now it's "functionally working" in that I can perform all the tasks I want to with it except for viewing procs. Redirects back from things like saving a user still error, but the user is still saved so whatever :)
@jacques I'll have to try and play around with that some this weekend, thanks! I haven't tried any rewrite fiddling yet since I never really needed to when using Apache, so I just assumed a similar proxy setup would take care of things.
from webmin.
Trying something like (not sure if this will work but give it a spin).
rewrite ^/webmin/(.*) /$1 break;
from webmin.
+1 I also see this issue. I have webprefix=/webmin
set in my webmin conf and all the other things discussed here.
location /webmin {
proxy_pass http://127.0.0.1:10000/;
proxy_redirect off;
proxy_read_timeout 3600s;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
I think webmin doesn't perfectly respect some of its own settings, because I still see it trying to redirect some things to myhost:10000
on seemingly random occasion, instead of myhost/webmin
.
So the webmin web app is basically usable, but frustrating.
from webmin.
Related Issues (20)
- Connection Lost error message HOT 62
- Web interface stopped working entirely after update HOT 3
- When i try to set the acl webmin gives me -R: no such file or directory HOT 1
- getting MS TEAMS meeting invites that do not show time and date of meeting HOT 12
- Tools - UPS Daemon: Error — Perl execution failed HOT 2
- href links in ui_checked_columns_row leads to partial page loading HOT 4
- Cyrus - Add ability to configure SASL authentication mechanisms HOT 3
- SpamAssassin - Header and Body Tests - 2 input boxes for expression? - Time for a single page? HOT 7
- Postfix - missing restrictions - `smtpd_data_restrictions` and `smtpd_end_of_data_restrictions`
- System Logs Viewer - Some improvements HOT 2
- Remove `SMTP Client Restrictions` and create `Access restriction lists` HOT 3
- System Monitor - Show what service binary is being monitored HOT 4
- FirewallD - Adding some more quick actions to give parity to CSF
- Postfix - `permit_networks` does not work HOT 13
- Load dynamic modules .conf file in different locations HOT 4
- Unclear / inconsistent logic for resulting color and style of buttons HOT 6
- postfix - SMTP TLS client security level GUI options does not change smtp_tls_security_level HOT 1
- Adding 'capwap-ac-v4' DHCP Option to the GUI? HOT 1
- Why is the temperature displayed incorrectly using sersors? HOT 9
- Webmin (UI) breaks with Error: 500 - Perl execution failed - Undefined subroutine (...) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webmin.