Nginx, Server, Webservice

Configurasi NGINX

PHP FPM

 

location ~ \.php$ {

    try_files $uri $uri/ /index.php$is_args$args;

    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

    fastcgi_index index.php;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    include fastcgi_params;

    fastcgi_read_timeout 3000;

}

 

Default for NodeJS

 

server {

    listen 80;

    server_name namadomain.com;

    location / {

        proxy_pass http://localhost:3001;

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection 'upgrade';

        proxy_set_header Host $host;

        proxy_cache_bypass $http_upgrade;

    }

}

 

Default for PHP

 

server {

    listen 80 default_server;

    listen [::]:80 default_server;

 

    root /var/www/html/public;

    index index.php;

    server_name _;

 

    location / {

        try_files $uri $uri/ /index.php$is_args$args;

    }

 

    include php74fpm;

 

    location ~ /\.ht {

        deny all;

    }

}

Contact

Get in Touch