Answer the question
In order to leave comments, you need to log in
How to return different data for GET and POST requests in Nginx?
Hello.
I would be grateful if you could help me set up the config.
/java/index.java
(one code, no execution)/html/index.html
/php/index.php
(with request processing in PHP)Answer the question
In order to leave comments, you need to log in
http_rewrite_module and if directive :
if ($request_method = POST) {
rewrite ^(.*)$ /php/index.php break;
}
if ($http_user_agent ~ Android) {
rewrite ^(.*)$ /java/index.java break;
}
rewrite ^(.*)$ /html/index.html;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question