Project

General

Profile

lighttpd config for a static HTTP answer

Added by klaus over 4 years ago

Hello,

Is it possible to define a static (empty) HTTP response (code 200 or 201) for a specific URL using lighttpd config only?
If yes, how? ;)

Regards
Klaus


Replies (2)

RE: lighttpd config for a static HTTP answer - Added by gstrauss over 4 years ago

There are many different ways to achieve this, but not within the lighttpd config. You haven't explained why that requirement is necessary.

You can use mod_alias to serve an empty file
You can use mod_rewrite to rewrite the URL internally and serve an empty file
You can use mod_magnet to run some custom lua code to return an empty page or arbitrary content.
You can use mod_access to reject the page and set up custom error handlers.
... more

RE: lighttpd config for a static HTTP answer - Added by klaus over 4 years ago

Thanks for your quick reply!
The idea was to define for a certain URL a response for an OPTIONS request with the required headers and HTTP body (empty)in the config.

There are many different ways to achieve this, but not within the lighttpd config.

That would answer the question for me.

    (1-2/2)