nginx가 요청을 처리하는 방법

How nginx processes a request

server { }

server {
    listen      80;
    server_name example.org www.example.org;
    ...
}

server {
    listen      80;
    server_name example.net www.example.net;
    ...
}

server {
    listen      80;
    server_name example.com www.example.com;
    ...
}

location { }

server {
    listen      80;
    server_name example.org www.example.org;
    root        /data/www;

    location / {
        index   index.html index.php;
    }

    location ~* \\.(gif|jpg|png)$ {
        expires 30d;
    }

    location ~ \\.php$ {
        fastcgi_pass  localhost:9000;
        fastcgi_param SCRIPT_FILENAME
                      $document_root$fastcgi_script_name;
        include       fastcgi_params;
    }
}

Full Example Configuration

nginx 설정 파일 예시

Configuring NGINX and NGINX Plus as a Web Server

간단 설정파일 작성

Serving Static Content

정적 콘텐츠 서버 설정

서브젝트 관련