Advertisement
AhmadFazliIsmail

Nginx conf file for Syafiq Faiz R03

Sep 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.81 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         server_name test.wa-essence.com;
  4.  
  5.     location / {
  6.         root /var/www/test_wa_essence;
  7.         index index.php index.html index.htm;
  8.         # Pilih mana2 1 je antara yg bawah ni. Dedua ni sama, so check mana yg compatible ngan ko punya PHP-FPM config.
  9.         location ~ \.php$ {
  10.             include snippets/fastcgi-php.conf;
  11.             fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  12.         }
  13.  
  14.         location ~ \.php$ {
  15.             include snippets/fastcgi-php.conf;
  16.             fastcgi_param SCRIPT_FILENAME $request_filename;
  17.             fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  18.         }
  19.         try_files $uri $uri/ /index.php$is_args$args;
  20.     }
  21.  
  22.     location /wachampionacademy {
  23.         root /var/www/;
  24.         index index.php index.html index.htm;
  25.         # Pilih mana2 1 je antara yg bawah ni. Dedua ni sama, so check mana yg compatible ngan ko punya PHP-FPM config.
  26.         location ~ \.php$ {
  27.             include snippets/fastcgi-php.conf;
  28.             fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  29.         }
  30.  
  31.         location ~ \.php$ {
  32.             include snippets/fastcgi-php.conf;
  33.             fastcgi_param SCRIPT_FILENAME $request_filename;
  34.             fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  35.         }
  36.         try_files $uri $uri/ /wachampionacademy/index.php$is_args$args;
  37.     }
  38.  
  39.     location ~ /\.ht {
  40.         deny all;
  41.     }
  42.  
  43.     location = /favicon.ico { log_not_found off; access_log off; }
  44.     location = /robots.txt { log_not_found off; access_log off; allow all; }
  45.     location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
  46.         expires max;
  47.         log_not_found off;
  48.     }
  49.  
  50. # SSL port 443 tu kena buka server block baru, kalau masih baru dalam Nginx better asingkan ngan port 80.
  51. # If better jangan pakai. Rujuk sini https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement