Home >Backend Development >PHP Tutorial >nginx reverse proxy configuration

nginx reverse proxy configuration

WBOY
WBOYOriginal
2016-07-28 08:26:031045browse

1. Explanation of terms

反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。

2. Official start

Find the conf/nginx.conf file, edit:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;


    server {
        listen       80;
        server_name  127.0.0.1:8080;

        location / {

            proxy_pass   http://127.0.0.1:8080;
        }

    }

}

Node under server:

listen: listen 80 Port
server_name: Which address to forward to
proxy_pass: Which address to proxy to

nginx common commands (to enter the nginx directory):

Open: start nginx
Restart: nginx -s reload

The above introduces the nginx reverse proxy configuration, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn