21 votes

Handling http and https requests using a single port with nginx

According to wikipedia article on status codes, Nginx has a custom error code when http traffic is sent to https port(error code 497) And according to nginx docs on error_page, you can define a URI ...
user avatar
  • 371
10 votes

Why are NginX and Lighttpd not affected by Slowloris?

valyala's comment should be accepted as the answer. Most nginx servers use default configs and therefore vulnerable to slowloris attack. I have used slowloris to take down some of my friend's nginx ...
user avatar
8 votes
Accepted

Lighttpd doesn't start after purging Apache

Okay, I see in the new output there that this is a known bug. See https://bugs.launchpad.net/ubuntu/+source/lighttpd/+bug/1453463 The text I looked for was: undefined symbol: FAMNoExists And the ...
user avatar
  • 2,526
7 votes
Accepted

Dual stack Lighttpd without repeating the SSL configuration

You can use variables and include configuration from files, see Configuration file syntax for the core module. We can use the latter here: $SERVER["socket"] == "0.0.0.0:443" { include "ssl.conf" } $...
user avatar
  • 4,125
6 votes

HAproxy 503 Service Unavailable No server is available to handle this request

Problem is in your HAProxy configuration. When I remove all comments from your config, I will get this: global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/...
user avatar
6 votes

Handling http and https requests using a single port with nginx

This is finally possible to do properly since 1.15.2. See the information here. In your nginx.conf add a block like this (outside the http block): stream { upstream http { server ...
user avatar
  • 297
5 votes

How to serve a wget --mirror'ed directory of files with questionmarks in them

wget downloads these directly to files named the same, complete with question marks. You can disable that behavior with --restrict-file-names=ascii,windows, this resolves your issue right on wget, ...
user avatar
5 votes
Accepted

missing mod_ssl.so for lighttpd

Delete that line from your modules list. SSL support is compiled into lighttpd and is not a separate module. If your version has this support compiled in the output of lighttpd -v will include (ssl)....
user avatar
  • 3,376
5 votes
Accepted

Error "SSL3_GET_CLIENT_CERTIFICATE:peer did not return a certificate" on lighttpd

The ssl.ca-file reads the content, you can call any file type here, even a .txt it doesn't matter for lighttpd if the content is a certificate or a certificate chain. When you enable ssl.verifyclient....
user avatar
4 votes

Make Lighttpd return 404 for unused subdomains?

You can use a little "trick" like shown on devsite.pl. } else $HTTP["host"] =~ "^something.domain.com$" { # .... } else $HTTP["host"] =~ ".*" { url.redirect-code=404 url.redirect = ( ".*" ...
user avatar
  • 41
4 votes
Accepted

Wrong IP with lighttpd reverse proxy

My bet? lighttpd is adding an X-Forwarded-For header, and Django has something hardcoded somewhere to know that 127.0.0.1 is unlikely to be the real remote IP address if that header's present. You ...
user avatar
3 votes

Using an EV SSL certificate for your site with non-EV SSL content

The insecure content blocking functionality is implemented by each browser and not really standardized. However, I do not know of any browser that is doing this. Browsers display the green bar when ...
user avatar
  • 24.9k
3 votes

HAproxy 503 Service Unavailable No server is available to handle this request

I got a similar error because HAProxy thought my backend was down due to the default health check it does. I disabled the health check and the 503 went away. I'm using pfsense GUI:
user avatar
  • 161
3 votes
Accepted

lighttpd does not start at boot after enabling ipv6

When IPv6 addresses are configured they aren't available immediately. The system first performs DAD (Duplicate Address Detection) to make sure that its new address doesn't conflict with an existing ...
user avatar
3 votes
Accepted

Lighttpd error log increases too fast

Somewhere in your config, you have this line: debug.log-request-handling = "enable" Comment it out by putting a # in front of it. To find out where it is, you can use grep: grep -nr 'log-request-...
user avatar
  • 4,125
3 votes

Lighttpd static file server 403 forbidden error

Another frequent issue is an active SELinux on the machine. Even with correct permissions on the directory tree, you will still get a 403 if the directory wasn't registered in SELinux. chcon -R -h -t ...
user avatar
3 votes
Accepted

Docker compose volumes invalid characters

The yaml is quite picky on docker compose. Make sure the path is absolute (for the host side) and contains no trailing spaces. "- volumes/log:/var/log/lighttpd " Should be "- /host/path/volumes/log:...
user avatar
  • 14.1k
3 votes

Redirect to https on lighttpd

After some additional search I found a solution. Added to lighttpd.conf restarted and everything works as expected. $HTTP["scheme"] == "http" { # capture vhost name with regex conditiona -> %0 in ...
user avatar
  • 151
3 votes
Accepted

Proxy URL to different port via Lighttpd

From your question it looks like you want to serve http://somehost.com/xxx/file from http://somehost.com:8080/file. In that case your config is wrong, because it is trying to serve http://somehost.com:...
user avatar
  • 2,593
2 votes

Rewrite URL before passing to proxy Lighttpd

This can be done with proxy.header since lighttpd v 1.4.46. See: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModProxy Example for above would be: $HTTP["url"] =~ "^/wsmobile/video/" { ...
user avatar
  • 131
2 votes

Lighttpd cannot create php-fastcgi.socket

Got Fixed with following changes: mkdir /var/run/lighttpd touch /var/run/lighttpd/php-fastcgi.socket chown -R lighttpd:lighttpd /var/run/lighttpd Where lighttpd is the username. Updating socket in ...
user avatar
2 votes

Serving image content over https, must encryption strength match that of the main website?

In brief , your correct to assume any external resource that is hosted on https:// with any type of SSL/TSL etc will cause no noticeable effect to any of your visitors. We had this exact same ...
user avatar
  • 121
2 votes

Retrieve external IP in PHP behind Haproxy

You will need to add the option "option forwardfor" in your HAproxy config file, so that HAproxy will add a new header with the visitor real IP address. After that, in your PHP code, check for the ...
user avatar
  • 206
2 votes
Accepted

Rewriting a download URL, but "save -as" dialog shows original URL

You just need to prefix your r=ca92b32 string with a ? (ie: http://<server>/foo/?r=ca93b32) The string will be considered as a parameter instead of a filename and won't be treated as a filename....
user avatar
2 votes

Rewriting a download URL, but "save -as" dialog shows original URL

rewrite is a server internal operation; the user doesn't see the result (unless you expose it manually in some way). You could try the Content-Disposition header; but the best way is to fix your URLs ...
user avatar
  • 819
2 votes

Architecting a web server hosting mixed small and large (100MB+) static content

This question reeks of premature optimization. I was hoping there would be something which would understand that one file is in high demand, for example when a new episode comes out, and would put ...
user avatar
  • 38.6k
2 votes

Architecting a web server hosting mixed small and large (100MB+) static content

I wouldn't expect there to be much difference, if any, between Apache/Nginx/Lighttpd in this case. I would expect Apache to be slightly more memory heavy assuming you trimmed down all the modules that ...
user avatar
  • 3,384
2 votes

lighttpd example.com/support to support.example.com

If everything is on the same server, you must setup a subdomain: Eg: ###### Subdomain settings ############## $HTTP["host"] == "support.example.com"{ server.document-root = "/home/lighttpd/...
user avatar
2 votes
Accepted

Lighttpd redirect non-www to www

In the first example you are messing with all type of quotation marks. Only " ", "programmer’s" quotes, are recognized as quotes in configuration files. You configuration now has curved quotes (”, “) ...
user avatar
  • 42.3k
2 votes
Accepted

Remove Lighttpd password auth for one path

This setup works for me great for me, as already said in the comments: server.modules += ( "mod_auth" ) auth.backend = "htdigest" auth.backend.htdigest.userfile = "/etc/lighttpd/passwd" $HTTP["url"] ...
user avatar
  • 4,125

Only top scored, non community-wiki answers of a minimum length are eligible