nginx 로 dist 서브

Sonak·2022년 8월 17일

도움이 될 만한 명령어들

ps -ef | grep nginx
sudo kill -9 33334
cd ..
ls
tree
rm
rmdir

nginx 경로를 찾아서 들어간다

sudo nano nginx.conf 를 들어가서 수정

user  [name] staff;  
//네임부분 변경, 이 안에서 주석은 #으로 처리한다 
worker_processes  1;



events {
    worker_connections  1024;
}


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

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';


    sendfile        on;

    keepalive_timeout  65;



    server {
    	// Localhost 포트 변경 
        listen       80;
        // 서버네임 변경 
        server_name  a.alcruit.com;

        location / {
        	// 경로 설정
            root   /Users//desktop/pro/page/alcruit/dist;
			
            // 경로에서 열 파일 지정
			index  index.html

        }

서브도메인 변경을 위해 hosts 변조

private/hosts

sudo nano hosts들어가서

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhostk

127.0.0.1 test.com 추가하고

마무리로
dscacheutil -flushcache

치면 적용 완료

profile
초보.

0개의 댓글