Last active
June 23, 2025 05:18
-
-
Save ankurk91/d6bb80692bb72c169f15c08985df85f6 to your computer and use it in GitHub Desktop.
Revisions
-
ankurk91 revised this gist
Jun 23, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,4 +56,5 @@ http { include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; #add_header X-Robots-Tag "noindex, nofollow" always; } -
ankurk91 revised this gist
Jun 23, 2025 . 2 changed files with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,36 @@ server { listen 80; listen [::]:80; server_name example.com; root /home/user/example.com/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; index index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ ^/index\.php(/|$) { fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; fastcgi_hide_header X-Powered-By; } access_log /var/log/nginx/example.com_access.log combined buffer=512k flush=1m; error_log /var/log/nginx/example.com_error.log warn; location ~ /\.(?!well-known).* { deny all; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ # /etc/nginx/sites-enabled/node-js.conf server { listen 80; listen [::]:80; server_name example.com; @@ -33,5 +35,4 @@ server { deny all; } } -
ankurk91 revised this gist
Jun 18, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ server { root /home/user-name/projects/laravel-app/public; index index.php index.html; charset utf-8; @@ -22,8 +22,8 @@ server { error_page 404 /index.php; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } -
ankurk91 revised this gist
Jun 4, 2025 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,9 @@ server { # ssl_certificate /etc/nginx/certs/laravel.test.pem; # ssl_certificate_key /etc/nginx/certs/laravel.test-key.pem; server_name example.com; root /home/user-name/projects/laravel-app/public; index index.php; @@ -32,6 +32,6 @@ server { deny all; } access_log /var/log/nginx/example.com_access.log combined buffer=512k flush=1m; error_log /var/log/nginx/example.com_error.log warn; } -
ankurk91 revised this gist
Jun 4, 2025 . 4 changed files with 38 additions and 27 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; multi_accept on; } http { This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ # /etc/nginx/sites-enabled/node-js.conf server { server_name example.com; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_cache_bypass $http_upgrade; # Proxy headers proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; # Proxy timeouts proxy_connect_timeout 60s; proxy_send_timeout 60s; proxy_read_timeout 60s; } access_log /var/log/nginx/example.com_access.log combined buffer=512k flush=1m; error_log /var/log/nginx/example.com_error.log warn; location ~ /\.(?!well-known).* { deny all; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,26 +0,0 @@ -
ankurk91 revised this gist
Jun 1, 2025 . 2 changed files with 2 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,9 +19,6 @@ server { try_files $uri $uri/ /index.php?$query_string; } error_page 404 /index.php; location ~ \.php$ { @@ -36,5 +33,5 @@ server { } error_log /var/log/nginx/laravel.test_error.log; access_log /var/log/nginx/laravel.test_access.log; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ server { server_name example.com; location / { proxy_pass http://localhost:3000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; @@ -15,9 +15,6 @@ server { proxy_cache_bypass $http_upgrade; } access_log /var/log/nginx/example.com_access.log; error_log /var/log/nginx/example.com_error.log; -
ankurk91 revised this gist
Jun 1, 2025 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ user www-data; worker_processes auto; pid /run/nginx.pid; error_log /var/log/nginx/error.log; include /etc/nginx/modules-enabled/*.conf; events { @@ -41,15 +42,13 @@ http { # Logging Settings ## access_log /var/log/nginx/access.log; ## # Gzip Settings ## gzip on; ## # Virtual Host Configs -
ankurk91 revised this gist
Jun 1, 2025 . No changes.There are no files selected for viewing
-
ankurk91 revised this gist
Jun 1, 2025 . 3 changed files with 8 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,6 @@ server { root /home/ankur/projects/laravel-app/public; index index.php; charset utf-8; @@ -27,7 +25,8 @@ server { error_page 404 /index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ server { server_name example.com; location / { proxy_pass http://localhost:5010; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Install on Ubuntu 22/24 ### Cleanups @@ -24,8 +24,8 @@ sudo systemctl enable nginx Hope you have already installed the php-cli, lets install the glue now ```bash sudo apt install php8.4-fpm sudo systemctl start php8.4-fpm ``` ### Ngnix service commands @@ -47,7 +47,7 @@ sudo systemctl reload nginx You can tweak `php.ini` at this location ``` /etc/php/8.4/fpm/php.ini ``` ### Links -
ankurk91 revised this gist
May 31, 2025 . 1 changed file with 29 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ server { server_name example.com; location / { proxy_pass http://localhost:5010; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; 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; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log /var/log/nginx/example.com_access.log; error_log /var/log/nginx/example.com_error.log; location ~ /\.(?!well-known).* { deny all; } } -
ankurk91 revised this gist
May 31, 2025 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,4 +35,7 @@ server { location ~ /\.(?!well-known).* { deny all; } error_log /var/log/nginx/laravel.test_error.log; access_log /var/log/nginx/laravel.test_access.log combined; } -
ankurk91 revised this gist
Nov 4, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Install on Ubuntu 20/22/24 ### Cleanups -
ankurk91 revised this gist
Jul 6, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ sudo apt remove "libapache2-mod-php*" ### Install Nginx ```bash sudo add-apt-repository ppa:ondrej/nginx -y sudo apt update sudo apt install nginx -y sudo systemctl enable nginx -
ankurk91 revised this gist
Mar 15, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,8 +23,8 @@ sudo systemctl enable nginx Hope you have already installed the php-cli, lets install the glue now ```bash sudo apt install php8.3-fpm sudo systemctl start php8.3-fpm ``` ### Ngnix service commands @@ -46,7 +46,7 @@ sudo systemctl reload nginx You can tweak `php.ini` at this location ``` /etc/php/8.3/fpm/php.ini ``` ### Links -
ankurk91 revised this gist
Dec 28, 2022 . 2 changed files with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ http { keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; client_max_body_size 100M; # server_names_hash_bucket_size 64; # server_name_in_redirect off; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Install on Ubuntu 20/22 ### Cleanups -
ankurk91 revised this gist
Dec 10, 2022 . 2 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ server { error_page 404 /index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,8 +23,8 @@ sudo systemctl enable nginx Hope you have already installed the php-cli, lets install the glue now ```bash sudo apt install php8.2-fpm sudo systemctl start php8.2-fpm ``` ### Ngnix service commands @@ -46,7 +46,7 @@ sudo systemctl reload nginx You can tweak `php.ini` at this location ``` /etc/php/8.2/fpm/php.ini ``` ### Links -
ankurk91 revised this gist
Sep 16, 2022 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,4 +52,5 @@ You can tweak `php.ini` at this location ### Links * https://github.com/h5bp/server-configs-nginx * https://www.digitalocean.com/community/tools/nginx * https://www.serverion.com/nginx-config/ * https://www.cloudbooklet.com/install-phpmyadmin-on-ubuntu-20-04-with-nginx/ -
ankurk91 revised this gist
Sep 16, 2022 . No changes.There are no files selected for viewing
-
ankurk91 revised this gist
Sep 16, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,6 @@ sudo apt remove "libapache2-mod-php*" ```bash sudo apt update sudo apt install nginx -y sudo systemctl enable nginx ``` -
ankurk91 revised this gist
Mar 2, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ server { error_page 404 /index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } -
ankurk91 revised this gist
Mar 2, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,8 +24,8 @@ sudo systemctl enable nginx Hope you have already installed the php-cli, lets install the glue now ```bash sudo apt install php8.1-fpm sudo systemctl start php8.1-fpm ``` ### Ngnix service commands @@ -47,7 +47,7 @@ sudo systemctl reload nginx You can tweak `php.ini` at this location ``` /etc/php/8.1/fpm/php.ini ``` ### Links -
ankurk91 revised this gist
Dec 1, 2021 . No changes.There are no files selected for viewing
-
ankurk91 revised this gist
Dec 1, 2021 . 3 changed files with 153 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # /etc/nginx/sites-enabled/laravel.conf server { listen 80; # listen 443 ssl; # ssl_certificate /etc/nginx/certs/laravel.test.pem; # ssl_certificate_key /etc/nginx/certs/laravel.test-key.pem; server_name laravel.test *.laravel.test; root /home/ankur/projects/laravel-app/public; add_header X-Frame-Options "SAMEORIGIN"; index index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,59 @@ # /etc/nginx/nginx.conf user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # SSL Settings ## ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; ## # Logging Settings ## #access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_static on; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,56 @@ # Install on Ubuntu 20 ### Cleanups :warning: If you have already installed apache, you must uninstall it ```bash sudo systemctl stop apache2.service sudo apt remove apache2 sudo apt remove "libapache2-mod-php*" ``` ### Install Nginx ```bash sudo apt update sudo apt install nginx -y sudo ufw allow in "Nginx" sudo systemctl enable nginx ``` ### Configure Nginx for PHP Hope you have already installed the php-cli, lets install the glue now ```bash sudo apt install php8.0-fpm sudo systemctl start php8.0-fpm ``` ### Ngnix service commands * Check for syntax errors ```bash sudo nginx -t ``` * Reload after updating the configurations ```bash sudo systemctl reload nginx ``` ### Tweak php.ini You can tweak `php.ini` at this location ``` /etc/php/8.0/fpm/php.ini ``` ### Links * https://github.com/h5bp/server-configs-nginx * https://www.digitalocean.com/community/tools/nginx * https://www.serverion.com/nginx-config/ -
ankurk91 created this gist
Dec 1, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Install