Install Nginx beserta kawan-kawannya.
Login ke DNS. Tambahkan subdomain. Misalkan, elv.nrahmads.org dan vio.nrahmads.org.
Buka konfigurasi /etc/nginx/sites-available/default. Tambahkan baris berikut :
server {
listen 9615;
server_name www.elv.nrahmads.org;
root /var/www/elv;
}
server {
listen 8989;
server_name www.vio.nrahmads.org;
root /var/www/vio;
}
Buka/buat konfigurasi /etc/nginx/conf.d/server.conf dan isi dengan baris berikut :
server {
listen 80;
server_name elv.nrahmads.org;
location / {
proxy_pass http://localhost:9615;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 8m;
client_body_buffer_size 128k;
}
}
server {
listen 80;
server_name vio.nrahmads.org;
location / {
proxy_pass http://localhost:8989;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 8m;
client_body_buffer_size 128k;
}
}
Restart service nginx.
Komentar
Posting Komentar