Configure nginx to support php, jsp, asp, aspx

Speaking of Nginx, everyone should be familiar with it. Although it appeared relatively late, its excellent performance has convinced many system engineers and has been widely adopted. There are many articles on the Internet about how to make nginx support jsp, asp, etc. I want to say that this statement is not correct, because nginx itself is just a static server and reverse proxy tool, and does not support dynamic pages. The so-called support for asp, jsp, php, etc. are just using nginx to do reverse. Just an agent. Let nginx support php through fastcgi has been introduced. Here we only introduce the method of letting nginx reverse proxy tomcat and other jsp containers to serve jsp pages: Assuming that you have configured tomcat and run it on port 8080 of your local machine, open your virtual machine configuration file and add the following lines: location / {proxy_pass http://127.0.0.1: 8080;proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header 128k;proxy_connect_timeout 30;proxy_send_timeout 30;proxy_read_timeout 30;proxy_buffer_size 4k;proxy_buffers 4 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k; } OK, jsp can run! Want to radially proxy IIS? apache? – go ahead and do it! PS: Now that the Windows version of Nginx has been officially launched, supporting Asp or .net is completely a…

Configure nginx to support PHP

Installing Nginx and php is not much to say here, after all, the online tutorials are already very comprehensive. Whether it is rpm, apt-get or downloading source code installation, just follow the steps, (PHP I use dpkg ?P php5-cgi and then apt-get install php5-cgi to install, the platform is Ubuntu) Here I want to talk about the php support mode, this part is a repost 1) Currently variousserversHTTP ServerSupport for PHP Total There are three: a. Through the built-in module of HTTPServer, For example, Apache‘s mod_php5, similar Apache’s built-in mod_perl can support perl; b. Realized by CGI, this is like the CGI of perl before, the disadvantage of this method is poor performance, because every time the server encounters these scripts, the script parser needs to be restarted to execute the script and then return the result to the server; On the one hand, it is not very secure; this aspect is almost rarely used. c. The latest one is called FastCGI. The so-called FastCGI is an improvement on CGI. It generally adopts a C/S structure. Generally, the script processor will start one or more daemon processes. Every time HTTPServer encounters a script, it will be directly delivered to the…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索