Skip to content

Instantly share code, notes, and snippets.

@4RSIM3R
Created September 26, 2023 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4RSIM3R/a9974c57b03d8c4e44e91259ca20e88d to your computer and use it in GitHub Desktop.
Save 4RSIM3R/a9974c57b03d8c4e44e91259ca20e88d to your computer and use it in GitHub Desktop.
[Nginx] Config
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
client_max_body_size 16M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
server {
root /var/www/html/kendali-backend/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
server_name nawa.kendali.xyz;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/nawa.kendali.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nawa.kendali.xyz/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
if ($host = nawa.kendali.xyz) {
return 301 https://$host$request_uri;
}
listen 80 ;
listen [::]:80 ;
server_name nawa.kendali.xyz;
return 404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment