Carambola Dev
ubuntu 서버 하나에서 dev/prod 서버 따로 구축하기 본문
/etc/nginx/sites-available/default에 추가하면 된다.
3001번 포트와 3002번 포트로 각각 접속이 가능하다. 포트는 바꾸어도 되고, 도메인을 사용해도 된다.
server {
listen 3001;
server_name _;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}
server {
listen 3002;
server_name _;
root /var/www/dev;
index index.php index.html index.htm index.nginx-debian.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}
'Computer Science' 카테고리의 다른 글
| Bash on Windows로 우분투를 사용할 때의 장점 (0) | 2021.01.14 |
|---|---|
| access denied for user 'root'@localhost' 에러 (0) | 2021.01.04 |
| Shell (0) | 2020.03.16 |
| 깃 & 깃허브 도서 요약 (0) | 2020.03.14 |
| IntelliJ 노트 (0) | 2020.03.13 |