# Nginx-Php8

Nginx-Php8 is a self-hosted network services app. A Docker image pairing the Nginx web server with PHP 8-FPM for serving PHP applications on your own hardware. It is open source and self-hosted, installable on Docker Hub and Unraid.

Canonical page: https://ourlocalhost.com/app/1433/nginx-php8

## Description

A Docker image pairing the Nginx web server with PHP 8-FPM for serving PHP applications on your own hardware.

## Platform availability

Available on 1 of 9 platforms: Unraid.

## Health score

54/100 (Fair), based on 3 of 4 factors.
- Maintained: 62 (last commit 133 days ago)
- Popular: 57 (699 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)

## Links

- GitHub: https://github.com/rryqszq4/ngx-php
- Docker Hub: https://hub.docker.com/r/tangramor/nginx-php8-fpm
- Official website: https://nginx.org/
- Unraid: https://ca.unraid.net/apps/nginx-php8-1mczs65000jqa9?q=nginx-Php8
- Documentation: https://nginx.org/en/docs/

## Common questions

### How can I prevent Nginx container permission errors when my host files are owned by a different user?

If you build the image, set the UID and GID build arguments to the user and group IDs that own your files on the host. This prevents Nginx from running as the wrong user and failing to read or write files.

### Why might a site show the default Nginx welcome page instead of the deployed application?

Seeing the default Welcome to nginx page instead of a website is a common configuration issue. The Nginx site or server configuration is the likely place to check.

### How do I enable the ngx-php embedded PHP module in nginx.conf?

Add load_module modules/ndk_http_module.so and load_module modules/ngx_http_php_module.so at the top of nginx.conf.

### What PHP coding patterns should be avoided when using ngx-php?

Global variables, static variables inside classes, and singleton patterns are unsafe for per-request use. Native IO functions work, but they slow down Nginx.

### How should SSL be handled if Nginx is reverse-proxying local backends?

A common approach is to terminate SSL at the reverse proxy and use plain connections to backend servers when all traffic stays on the LAN.

## Alternatives

- Apache HTTP Server: Open-source HTTP server offering cross-platform support, modular architecture, secure configuration, robust content delivery, and extensive…
- BunkerWeb: BunkerWeb is a self-hosted, open-source web application firewall and NGINX-based web server that protects services with secure-by-default s…
- Caddy: Caddy is an extensible web server and reverse proxy that serves Transport Layer Security (TLS) by default, making it simple to secure and r…
- Haproxy: HAProxy is a TCP proxy and a HTTP reverse proxy.
- Microsoft IIS: Internet Information Services (IIS) for Windows® Server is a flexible, secure and easy-to-manage Web server for hosting anything on the Web.
- Træfik Proxy: The Cloud Native Application Proxy Simplify networking complexity while designing, deploying, and operating applications.
- Varnish: Varnish is an open-source HyperText Transfer Protocol (HTTP) accelerator for website operators that serves cached pages from memory in fron…

---
Source: Our Local Host (https://ourlocalhost.com/app/1433/nginx-php8), the self-hosted and open-source app directory.
