Closed
Description
I wanted to switch from Apache2 to Nginx and followed the instructions for my Nginx config file here:
https://phpipam.net/news/phpipam-on-nginx/
First I couldn't get the Unix socket to work so I switched over to using fastcgi_pass 127.0.0.1:9000;
, which seems to work better. However, I only get a blank page when going to ipam.mydomain.com. If I go to ipam.mydomain.com/index.php, it displays the contents of the file instead of rendering the page.
I've looked at various issues here and elsewhere but it seems something about the suggested Nginx config is broken.
My Nginx config file (on Alpine Linux 3.8):
server {
# virtual server name i.e. domain name
listen 80;
server_name ipam.mydomain.com;
# root directory
root /var/www/localhost/htdocs;
# phpipam
location / {
try_files $uri $uri/ /index.php;
index index.php;
}
# phpipam - api
location /api/ {
try_files $uri $uri/ /api/index.php;
}
# log files
access_log /var/log/nginx/ipam.mydomain.com_access.log;
error_log /var/log/nginx/ipam.mydomain.com_error.log;
# php-fpm
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
try_files $uri $uri/ index.php = 404;
include fastcgi_params;
}
}
Metadata
Metadata
Assignees
Labels
No labels