[GH-ISSUE #249] Run WebVirtMgr on subdirectory instead of subdomain/domain #196

Closed
opened 2026-02-27 16:38:21 +03:00 by kerem · 2 comments
Owner

Originally created by @camjac251 on GitHub (Feb 27, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/249

My current nginx config setup is
server {
listen 80;
root /usr/share/nginx/www;
index index.php index.html index.htm;

    server_name www.mywebsite.com;
    location / {
    try_files $uri.html $uri $uri/ =404;
    }
    error_page 404 /404.html;
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }

server {
listen 80;
server_name panel.mydomain.com;
access_log /var/log/nginx/webvirtmgr_access_log;
location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $remote_addr;
}

If I try to add

location /panel {
    proxy_pass http://127.0.0.1:8000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $remote_addr;
}

to my first config, it will give me webvirts error, and try to load resources from http://mydomain.com/ instead of http://mydomain.com/panel

Has anyone been able to get this working on a subdirectory? I would like to know how.
The reason why I'd like to do this is because I will be getting an EV SSL cert and would like everything secured under it, not have multiple subdomains with more ssl's.

Originally created by @camjac251 on GitHub (Feb 27, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/249 My current nginx config setup is server { listen 80; root /usr/share/nginx/www; index index.php index.html index.htm; ``` server_name www.mywebsite.com; location / { try_files $uri.html $uri $uri/ =404; } error_page 404 /404.html; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } server { listen 80; server_name panel.mydomain.com; access_log /var/log/nginx/webvirtmgr_access_log; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $remote_addr; } ``` If I try to add ``` location /panel { proxy_pass http://127.0.0.1:8000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $remote_addr; } ``` to my first config, it will give me webvirts error, and try to load resources from http://mydomain.com/ instead of http://mydomain.com/panel Has anyone been able to get this working on a subdirectory? I would like to know how. The reason why I'd like to do this is because I will be getting an EV SSL cert and would like everything secured under it, not have multiple subdomains with more ssl's.
kerem closed this issue 2026-02-27 16:38:21 +03:00
Author
Owner

@retspen commented on GitHub (Feb 28, 2014):

Subdirectory doesn't work or reallocate all route in urls.py (add /panel before all url)

<!-- gh-comment-id:36333445 --> @retspen commented on GitHub (Feb 28, 2014): Subdirectory doesn't work or reallocate all route in urls.py (add /panel before all url)
Author
Owner

@camjac251 commented on GitHub (Feb 28, 2014):

But is it possible?

<!-- gh-comment-id:36359192 --> @camjac251 commented on GitHub (Feb 28, 2014): But is it possible?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#196
No description provided.