loudapet / 42webserv

This project is about writing one's own HTTP server
2 stars 0 forks source link

Return in location & server blocks in config #40

Closed andreaulicna closed 3 months ago

andreaulicna commented 3 months ago

NGINX: https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return

Relevant variables in location:

"Invalid" return behaviour: Even if the return location is "invalid", meaning that it isn't explicitly defined in the server config, it doesn't necessarily mean there will be an error. When Nginx receives a request for a location with a return directive in it, it will respond with that return. The client should then make a new request to the returned location. That request will be evaluated against the server config, and if there's no specific location block for the returned location, either the default location block will be used, or the 404 Not Found error will be returned.