I want to achieve something like this:
server {
listen 80;
location / {
return 200 <html><body>Hello World</body></html>
}
}
i.e., any request should return the inline html. Is this possible with NGINX?
EDIT:
I tried this:
server {
listen 80;
location / {
return 200 '<html><body>Hello World</body></html>'
}
}
But testing in browser did not render the html, instead the browser tried to download a file containing the html which is not the behavior I wanted.

所有评论(0)