How to Create Nginx Virtual Hosts to Serve PHP in macOS



How to Create Nginx Virtual Hosts to Serve PHP in macOS

How to Create Nginx Virtual Hosts to Serve PHP in macOS

Assalamualaikum and good day.

Welcome to Shuami Labs. This video will show you how to set up Nginx virtual hosts to serve PHP files in macOS. I am using mac with Intel processor. It is important to tell you here because Homebrew uses different paths for Apple Silicon processor. Follow the simple steps. I Hope you will learn something. All the best.

code for ref:
server {
listen 80;
server_name apps.nginx;

root /Users/shuami/MyDevelopment/MyPHP/apps;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ .php {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

Don’t forget to subscribe. Thank you.

Song: Cuckoo’s Nest by Nat Keefe & Hot Buttered Rum
Music from YouTube Audio Library

Follow and subscribe me @
youtube: https://www.youtube.com/c/ShuamiLabs
facebook: https://facebook.com/shuamilabs
instagram: https://instagram.com/shuamilabs

Follow and subscribe to my other social media at
youtube: https://www.youtube.com/c/PokdeStudios
facebook: https://facebook.com/pokdestudios
instagram: https://instagram.com/pokdestudios

#nginxwebserver #nginxvirtualhostsonmac #setupnginxphponmac #phpnginxvirtualhosts #virtualhostsphpnginx #pemasangannginxvirtualhostsdalammac #nginxvirtualhostsdalammac

Comments are closed.