I want to setup a portable nginx server and later put it on a usb stick
I’m new to nginx and asked google gemini ai “windows portable nginx with php, how to install and setup”.
portable-server/
├── html/ ← Your website/code files (document root)
├── nginx/ ← Extract Nginx zip here
├── php/ ← Extract PHP zip here
├── start.bat ← Batch file to start the server
└── stop.bat ← Batch file to stop the server
nginx.conf in “C:\portable-server\nginx\conf”:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root ../html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
html files work, php not (probably somehow root ../html; not working). how do I make it work with php files?