본문 바로가기
개발/ubuntu

[ubuntu] nginx 경로

by 적아38 2021. 7. 1.
728x90

1. nodejs 설치

apt-get install -y nodejs

 

2. npm 설치

apt-get install -y npm

 

3. npm 버전확인

npm i -g n

 

4. 패키지 설치

n lts

 

5. 디렉토리 생성

mkdir /var/www/chatting

 

6. Nginx 설정파일 수정

cd /etc/nginx/sites-available

 

vi chatting

server {
listen 443 ssl;
listen [::]:443 ssl;
root /var/www/#{디렉토리};

index index.html index.php  index.htm index.nginx-debian.html;

server_name #{서버경로};

        ssl_certificate #{crt 파일경로};
        ssl_certificate_key #{key 파일경로};

location ~* \.io {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy false;

proxy_pass https://~
proxy_redirect off;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

}

ln -s /etc/nginx/sites-available/#{chatting} /etc/nginx/sites-enabled/

728x90

'개발 > ubuntu' 카테고리의 다른 글

[Nginx] Nginx 리다이렉션  (0) 2021.10.28
[ubuntu] SSL 갱신  (0) 2021.08.13
[ubuntu] Nginx + Socket.io 설정  (0) 2021.07.01
[ubuntu] Argument list too long  (0) 2021.06.23
[ubuntu] mysql replication 설정  (0) 2021.06.11

댓글