[Kimchi-devel] [HELP] Problems with lighttpd
Aline Manera
alinefm at linux.vnet.ibm.com
Thu Jan 15 12:15:19 UTC 2015
Hi Ramon,
I found out the following links that can help you:
- http://redmine.lighttpd.net/projects/1/wiki/HowToRedirectHttpToHttps
- http://stackoverflow.com/questions/21429267/lighttpd-http-to-https
On 14/01/2015 12:01, Ramon Medeiros wrote:
> Hi Team,
>
> i'm trying to switch from nginx to lighttpd as kimchi proxy. I
> successfully create the proxy on port 8001, but the problem is the
> redirection from http to https.
>
> To try this, do:
>
> 1) Install lighttpd
>
> 2) Start kimchi, kill nginx process
>
> 3) Run lighttpd with this configuration (save to
> /etc/kimchi/lighttpd.conf):
>
> # Variables
> var.log_root = "/var/log/lighttpd"
> var.server_root = "/var/www"
> var.state_dir = "/var/run"
> var.home_dir = "/var/lib/lighttpd"
> var.conf_dir = "/etc/lighttpd"
> var.vhosts_dir = server_root + "/vhosts"
> var.cache_dir = "/var/cache/lighttpd"
> var.socket_dir = home_dir + "/sockets"
>
> # Server settings
> server.username = "lighttpd"
> server.groupname = "lighttpd"
> server.document-root = server_root + "/lighttpd"
> server.pid-file = state_dir + "/lighttpd.pid"
> server.errorlog = log_root + "/error.log"
>
> # Server modules
> server.modules = (
> "mod_proxy",
> "mod_redirect",
> "mod_accesslog",
> )
>
> # debug settings
> debug.log-request-handling = "enable"
> debug.log-request-header = "enable"
> debug.log-request-header-on-error = "enable"
> debug.log-response-header = "enable"
> debug.log-file-not-found = "enable"
> debug.log-condition-handling = "enable"
>
> # VIRTUAL HOSTS
>
> # Main server
> $SERVER["socket"] == ":8001" {
> server.port = 8001
> ssl.engine = "enable"
> ssl.pemfile = "/etc/kimchi/kimchi.pem"
> # server.document-root = server_root + "/lighttpd"
> proxy.debug = 1
> proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8010 )))
> }
>
> # redirect from http to https
> $SERVER["socket"] == ":8000" {
> server.port = 8000
> server.document-root = server_root + "/lighttpd"
>
> $HTTP["host"] =~ "[^0-9:]*" {
> url.redirect = ("[^0-9:]*" => "https://%0:8001$0")
> }
> }
>
>
> 4) Run with /usr/sbin/lighttpd -D -f /etc/kimchi/lighttpd.conf.
>
> You will can access https://localhost:8001 with no problems, but, if
> you try to access localhost:8000, you will be redirect to
> https://127.0.0.1:8010.
>
> I did not understand why this is happening. Can someone please take a
> look?
>
More information about the Kimchi-devel
mailing list