NginX 환경설정

Published by onesixx on

 

Overview

Master 환경파일

위치는 (nginx -h)로 확인해 보면, /etc/nginx/nginx.conf  여기에 있다. 
include를 통해 여러파일을 포함시킬수 있다. 
블럭{ }은 하위 블럭{ }을 가질수 있고(예, http블럭 아래 여러 server블럭),
블럭{ }간에 설정을 상속한다.

Structure Block

http 블럭

Protocol 수준
여러개 삽입가능하지만, 1개면 족하다.

server 블럭

Server 수준
http블럭 안에서, 하나의 website 선언(Virtual host)

location 블럭

URI 수준
Server블럭 안 or  다른 Location블럭 안에서, website의 특정위치에 적용할 설정그룹 정의

 

 

 

여러 도메인을 통해 하나의 서비스를 하는 경우

ex> www.onesixx.com 과 onesixx.com 을 모두 onesixx.com으로 forwarding하려면 

server {
    listen       80;
    server_name  www.onesixx.com;
    return       301 http://onesixx.com$request_uri;
}
server {
    listen       80;
    server_name  onesixx.com;
    
    # 나머지 설정들....
}

 

 

Categories: Ubuntu

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x