๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์„œ๋ฒ„/AWS

Nginx ํ†ฐ์บฃ ์—ฐ๋™

by yunamom 2022. 2. 10.
๋ฐ˜์‘ํ˜•

 

80 ํฌํŠธ(Nginx)๋กœ ์š”์ฒญ์ด ์™”์„๋•Œ 8080 ํฌํŠธ(tomcat) ์œผ๋กœ ์—ฐ๊ฒฐ์‹œํ‚ค๋Š” ์„ค์ •

$ sudo vi /etc/nginx/sites-enabled/default

//location ์— ์„ค์ •์ถ”๊ฐ€์ž‘์„ฑ

location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                proxy_pass http://localhost:8080;
                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;
        }
        
//i ๋ˆŒ๋Ÿฌ์„œ ์ž‘์„ฑํ›„ :wq ์ €์žฅํ›„ ์ข…๋ฃŒ

$ sudo service nginx restart

 

 

๊ทธํ›„์— https:// ๋„๋ฉ”์ธ ์œผ๋กœ ์ ‘์†ํ•˜๋ฉด ํ†ฐ์บฃํ™”๋ฉด์ด ๋‚˜์˜ค๋Š”๊ฒƒ์„ ํ™•์ธํ• ์ˆ˜์žˆ๋‹ค! :)

300x250

์ฝ”๋“œ