Project

General

Profile

[Solved] How to have alias URL for specific port?

Added by Tab almost 6 years ago

Hello,
I have a web application made with Django 2.0.5, installed in a virtual environment on Debian 9, on which I installed Gunicorn and lighttpd. I installed my web app in /opt/djangoproject/mywebapp. I configured lighttpd adding these lines to my lighttpd.conf

$HTTP["url"] !~ "/static" {
proxy.server = ( "" => ( (
"host" => "192.168.1.15", 
"port" => 8001
) ) )
}

alias.url = ( "/static/" => "/opt/djangoproject/mywebapp/mystaticfiles" )

The problem is that the alias only work on port 80 instead of to work on 8001.


Replies (6)

RE: How to have alias URL for specific port? - Added by Tab almost 6 years ago

I did not think it was a cross-posting but simply a specific "lighttpd" questions ;-)

RE: How to have alias URL for specific port? - Added by gstrauss almost 6 years ago

I did not think it was a cross-posting but simply a specific "lighttpd" questions ;-)

Crossposting and multiposting:
https://en.wikipedia.org/wiki/Crossposting

For your specific question, either the question and context are poorly specified, or you don't understand the difference between a web server (e.g. lighttpd) running on port 80 and gunicorn running on 8001, as has already been posted on stackoverflow. I think it is the latter, which is not lighttpd-specific.

RE: How to have alias URL for specific port? - Added by Tab almost 6 years ago

As I wrote on stackoverflow

  • Gunicorn run only on 192.158.1.15:8001 (with this static ip)
  • Lighttpd run on port 80 (default port)
  • Debian is installed on a server and I have to reach it from every device connected on the same network

In Lighttpd conf file I only set those lines:

$HTTP["url"] !~ "/static" {
proxy.server = ( "" => ( (
"host" => "192.168.1.15", 
"port" => 8001
) ) )
}

alias.url = ( "/static/" => "/opt/djangoproject/mywebapp/mystaticfiles" )

What others details do you want?

RE: How to have alias URL for specific port? - Added by gstrauss almost 6 years ago

What others details do you want?

I'd like you to read my initial response on stackoverflow and then demonstrate some attempt to understand it by asking a more specific question. It's clear that you don't know what you're doing, but if you'd like assistance, you'll have to make more of an effort since nobody can read your mind. How about showing us what you think is happening. Who is making the request? Client browser? What are the headers? Who is responding? lighttpd? gunicorn?

RE: How to have alias URL for specific port? - Added by gstrauss over 3 years ago

Tab posted on https://stackoverflow.com/questions/50419545/how-to-configure-lighttpd-to-serve-django-static-files that he ignored the error messages from lighttpd which indicated that he had not loaded "mod_proxy" in @server.modules

    (1-6/6)