This is an old revision of the document!
Nginx
Example Server Blocks
Laravel
server { listen 80; server_name www.switchart.tk switchart.tk; root /web/switchart.tk/public; index index.php index.html; location / { try_files $uri $uri/ /index.php?query_string; } location ~ \.php$ { #include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).*{ deny all; } error_page 404 /404.html; }
React
server { listen 80 default_server; server_name www.schedukal.ml schedukal.ml; root /web/schedukal.ml; index index.php index.html; location / { try_files $uri /index.html; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).*{ deny all; } error_page 404 /404.html; listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/kalen.pw/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/kalen.pw/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot }
Vue
server { listen 80; listen 443 ssl; # managed by Certbot server_name www.kalen.pw kalen.pw; root /web/kalen.pw; index index.php index.html; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } error_page 404 /404.html; ssl_certificate /etc/letsencrypt/live/kalen.pw/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/kalen.pw/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot #if ($scheme != "https") { # return 301 https://$host$request_uri; #} # managed by Certbot }