[GH-ISSUE #78] Question: Configure Virtual Host #52

Open
opened 2026-02-27 15:57:09 +03:00 by kerem · 1 comment
Owner

Originally created by @FalkAlexander on GitHub (Dec 22, 2015).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/78

Hi,

I didn't found out how to configure the virtual host of Webvirtcloud with Nginx in a way that Webvirtcloud is accessible under example.com/virt or another subfolder as an url.
I tryed the "STATIC_URL" setting in the settings.py and also changed the url in the nginx config, but all this didn't helped.

Can someone help?

Originally created by @FalkAlexander on GitHub (Dec 22, 2015). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/78 Hi, I didn't found out how to configure the virtual host of Webvirtcloud with Nginx in a way that Webvirtcloud is accessible under example.com/virt or another subfolder as an url. I tryed the "STATIC_URL" setting in the settings.py and also changed the url in the nginx config, but all this didn't helped. Can someone help?
Author
Owner

@savichev commented on GitHub (Dec 23, 2015):

Hi! may be helped

upstream gunicorn_server {
    #server unix:/srv/webvirtcloud/venv/wvcloud.socket fail_timeout=0;
    server 127.0.0.1:8000 fail_timeout=0;
}
server {
    listen 80;

    server_name servername.domain.com;
    access_log /var/log/nginx/webvirtcloud-access_log; 

    location /virt/static/ {
        root /srv/webvirtcloud;
        expires max;
    }
    location /virt {
        rewrite /virt/(.*) /$1 break;
        proxy_pass http://gunicorn_server;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Forwarded-Proto $remote_addr;
        proxy_connect_timeout 600;
        proxy_read_timeout 600;
        proxy_send_timeout 600;
        client_max_body_size 1024M;
    }
}
<!-- gh-comment-id:166807363 --> @savichev commented on GitHub (Dec 23, 2015): Hi! may be helped ``` upstream gunicorn_server { #server unix:/srv/webvirtcloud/venv/wvcloud.socket fail_timeout=0; server 127.0.0.1:8000 fail_timeout=0; } server { listen 80; server_name servername.domain.com; access_log /var/log/nginx/webvirtcloud-access_log; location /virt/static/ { root /srv/webvirtcloud; expires max; } location /virt { rewrite /virt/(.*) /$1 break; proxy_pass http://gunicorn_server; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Proto $remote_addr; proxy_connect_timeout 600; proxy_read_timeout 600; proxy_send_timeout 600; client_max_body_size 1024M; } } ```
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/webvirtcloud#52
No description provided.