์ด๋ฒ ํฌ์คํ ์ ์๋ฒ ํธ์คํ ์ค ์ฐธ๊ณ ์ฉ์ผ๋ก ๋จ๊ฒจ๋๋ ํ์ด๋ค.
1. ๊ฐ์ ๋ค๋ฅธ ํฌํธ๋ก ์๋ฒ ํธ์คํ
dotnet test.dll --urls=http://localhost:5000/
์คํฌ๋ฆฐ ๋๋ ์๋น์ค๋ก ๋ฑ๋ก
dotnet test.dll --urls=http://localhost:6000/
2. ์ค์น๋ Nginx์ default ํ์ผ์ ์์ ํด์ผํ๋ค
sudo nano /etc/nginx/sites-available/default
์๋์ ๊ฐ์ด ์์
server {
listen 80;
server_name my.test.com;
location / {
access_log /home/veiz/access.log;
error_log /home/veiz/error.log;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Conneciton keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 90;
server_name my.test2.com;
location / {
access_log /home/veiz/access.log;
error_log /home/veiz/error.log;
proxy_pass http://localhost:6000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Conneciton keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
80๋ฒ ํฌํธ๋ก ์ ๊ทผํ๊ฒ ๋๋ฉด http://localhost:5000; ๋ก ํ๋ก์ ํจ์ค๋ฅผ ์ ์ฉํ๊ฒ ๋๊ณ
90๋ฒ ํฌํธ๋ก ์ ๊ทผํ๊ฒ ๋๋ฉด http://localhost:6000; ๋ก ํ๋ก์ ํจ์ค๋ฅผ ์ ์ฉํ๊ฒ ๋จ.
3. Nginx ๊ตฌ์ฑํ์ผ ํ ์คํธ ํ ์ฌ๊ฐ๋.
sudo nginx -t
sudo nginx -s reload
'๐ง Linux' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Linux] ์ฌ์ฉ์ ๋ฐ ๊ทธ๋ฃน ๊ด๋ฆฌ ๋ช ๋ น์ด (0) | 2023.01.18 |
---|---|
[Linux] ๊ธฐ๋ณธ ๋๋ ํฐ๋ฆฌ ๊ตฌ์กฐ (0) | 2022.10.25 |
[Linux] ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด์ Code-Server๋ฅผ ์ด๊ณ ์์ดํจ๋์์ VisualStudio Code๋ก ์ฝ๋ฉํ์ (0) | 2022.06.23 |
[Linux]๋ผ์ฆ๋ฒ ๋ฆฌํ์ด๋ก ์ ๊ธฐ๋ฃ 500์์ง๋ฆฌ ์๋ฒ ๋ง๋ค๊ธฐ - 1 (0) | 2022.06.17 |
[ASP.NET Core 5.0] Nginx๋ฅผ ํตํ Linux์๋ฒ์ ๋ฐฐํฌ (0) | 2022.05.09 |