Reply with 200 from Nginx config without serving a file
2016-12-14 15:37
477 查看
参考:http://serverfault.com/questions/196929/reply-with-200-from-nginx-config-without-serving-a-file
用nginx返回200,外加一行字符串,会被当成文件下载,如果不想这样,可以使用这样的配置。
即
用nginx返回200,外加一行字符串,会被当成文件下载,如果不想这样,可以使用这样的配置。
location / { return 200 'gangnam style!'; # because default content-type is application/octet-stream, # browser will offer to "save the file"... # if you want to see reply in browser, uncomment next line # add_header Content-Type text/plain; }
即
location / { return 200 'your json string'; add_header Content-Type text/plain; }
相关文章推荐
- MySQL - Found option without preceding group in config file
- MySQL - Found option without preceding group in config file
- java 读取配置(read config from file)
- 处理nginx启动错误Failed to read PID from file /run/nginx.pid
- Creating a XML Document from scratch without using a file in C#
- Configuring ELMAH to send emails without putting your password in the config file
- 从smack-config.xml文件中加载文件内容 Loads the configuration from the smack-config.xml file
- MySQL报错:Found option without preceding group in config file
- How to get the "connection string" from web.config file
- NOAUTH Authentication required redis(二) The server is ruuning without a config file
- mysql启动错误之eror: Found option without preceding group in config file: /Users/gukey/.my.cnf at line: 1
- [导入]Processing A .aspx File From Console Window, Without Using IIS
- How to: Reading an ini config file from a batch file
- 使用CSVRead, CSVData Set Config, __StringfromFile从外部读取参数
- 转:Manage Web.config from XML File by using configSource attribute ASP.Net 2.0
- MySQL报错: Found option without preceding group in config file:XXX; Fatal error in defaults handling.
- Mac 上mysql启动报错Starting MySQL... ERROR! The server quit without updating PID file
- How to move a datafile from a file system to ASM (Doc ID 390274.1)
- report from reportviewer without viewing the control
- Resource Generator, generate .resources from .txt file