All Questions
1,034
questions
0
votes
0
answers
26
views
Start and stop PHP when nginx as a Windows service is started or stopped [closed]
I installed nginx using Chocolatey and it's installed as a Windows service. I want nginx to start PHP when it's started and stop the PHP program when it's stopped. Are there ways for nginx to run ...
0
votes
0
answers
28
views
All .PHP pages give 5x error in nginx
I followed this guide to install Nginx and PHP on a CentOS server. I am able to do things like php --version and even use the interactive shell. But inside of /usr/share/nginx/html/, I make a PHP file ...
0
votes
0
answers
30
views
Updated upload_max_filesize and post_max_size in php.ini but still cant upload large files
I am using a Laravel based app on Ubuntu 22.04, Nginx, php8.2-fpm.
I have deployed the same app on 2 other servers but they use Ubuntu 20.04 and php8.1-fpm.
In each case I updated the php.ini of both ...
0
votes
2
answers
68
views
How to switch PHP versions in Nginx if fastcgi_pass is pointing to a TCP socket
My question is simple (I hope).
Everywhere on the internet I read that if I want to change PHP versions in Nginx, I need to change the UNIX socket of the fastcgi_pass parameter. But my fastcgi_pass ...
0
votes
1
answer
74
views
502 Bad Gateway nginx 1.20.1
I know why is this coming.
But I don't know how to fix it.
I was installing osticket following this article.
https://www.vultr.com/docs/how-to-install-osticket-on-centos-7/
Turns out current osticket ...
2
votes
0
answers
96
views
Docker nginx + php performance
I am using docker-compose to run an nginx container and a PHP container. I have a performance issue, where each 4th or 5th request to a simple PHP script takes several seconds (normally <<1s).
I ...
1
vote
1
answer
71
views
How to serve php files from a folder outside of web root folder in nginx
When i go to url www.example.gr i want to load a form where i will be able to submit it to www.example.gr/php/mail.php.
My files and folders structure is like this
root folder ( /var/www/html/app/ ) ...
0
votes
0
answers
28
views
NGINX- different web paths to different folders
I need to redirect different web paths to different folders on server.
http://test.local/site1/ => /srv/site_1/src/public
http://test.local/site2/ => /srv/site_2
tried such config, but it does ...
0
votes
1
answer
118
views
Issue with Web Server running PHP thru Reverse Proxy
I'm using an NGINX reverse proxy, with wild card certs installed on the reverse proxy.
Routing the NGINX reverse proxy traffic to standard web servers that are running Apache2 and NGINX Web services ...
0
votes
0
answers
45
views
system load spikes causing php-fpm pools to fill and cause micro outages
kind of at my wits end at this point and looking for some help.
2 physical Web servers
CentOS
NGINX
PHP5
php-fpm
2 physical DB Servers
CentOS
NGINX
elastic search
zookeeper
couchbase
as user load ...
0
votes
2
answers
144
views
telnet to port 80 (nginx), with forward to apache2 at port 8080, fails with 'connection closed by foreign host' and no explanations seemingly anywhere
i'm running an Kubuntu 22.04 server, and want to shuttle LAN-only traffic from port 80, served as far as i can tell by nginx, to port 8080 served by apache2 (for PHP purposes).
but i'm getting this &...
0
votes
1
answer
304
views
PHPMyAdmin Fresh Install Error 500 Nginx
I've just done a fresh install of phpmyadmin on nginx and ubuntu 22.04, however navigating to the index page is returning HTTP 500.
My error.log:
2023/06/24 22:52:55 [error] 1448200#1448200: *1 ...
0
votes
1
answer
71
views
Nginx sets HTTP_HOST to punycode
I have a unicode domain name. It is configured as punycode in the server_name directive.
When I call $_SERVER['HTTP_HOST'] in my PHP code, I get that same punycode version. How do I configure Nginx to ...
0
votes
1
answer
197
views
Frequent server downtime and suspicious server hits to access random Pdf files
Our Server hosting PHP web application is facing frequent downtime
Server Information [Nginx, FreeBSD] Web application [PHP 5.6, MYsql 5.7]
I have gone through the Nginx logs and below are my findings
...
1
vote
1
answer
259
views
Two PHP sites under Docker + nginx cant communicate with each other
I am using Docker + NGINX to host two PHP sites. The sites are accessible from the outside but the problem arises when I try to access one site from another using cURL or file_get_contents.
The ...
0
votes
1
answer
86
views
NGINX proxy fails to disconnect sessions on target Apache server
I have a PHP script running on an Apache server which is responsible for disconnecting all user sessions.
For that, it makes a loop that identifies itself as the session that should be disconnected ...
0
votes
0
answers
177
views
NGINX + PHP + ASDF: asdf plugin is using PHP 5.6 instead of 7.4
Goal: I need to load a PHP website (7.4) running NGINX using ASDF plugin.
(Mac OS, M2 processor, NGINX and ASDF installed)
issue:
when I load the website via nginx I get this:
Fatal error: Composer ...
0
votes
1
answer
57
views
Do not log access to some php scripts
I would like to exclude from access.log access to some php scripts.
To do this, I did the following:
location ~ ^/lib/exe/(jquery|taskrunner|css|js)\.php$ {
access_log off;
#...
0
votes
0
answers
36
views
PHP 7.4 FPM under Nginx serves wrong class from cache
We have a Linux environment serving a few different applications, all written in PHP 7.4. They are served out of a single Nginx web server using virtual hosts, and are all using FPM.
In our code we ...
0
votes
0
answers
98
views
Nginx 502 Bad Gateway CentOS7, PHP 7.3.33 FPM
I am new on CentOS 7. Trying to install Postfix on centOS7 with Nginx. I am following a tutorial, but I get an error message.
I have a 502 Bad Gateway on my server, http://domainname.com , how do I ...
1
vote
1
answer
194
views
PHP-FPM static max_children amount doesn't seem to matter much during stress tests
I've been stress testing PHP-FPM set up as static using wrk, with NGINX running on Ubuntu Server 22.04 for the past few days, writing down results for every scenario. When I look at them, it seems to ...
-1
votes
1
answer
29
views
Trouble Formatting Nginx Server Block
So I'm trying to set it up where my subdomain: "forum.project-freedom.net" visits the directory of /var/www/forum/ on my server. I'd like the main URL, "project-freedom.net" to be ...
0
votes
1
answer
326
views
Nginx header HTTPOnly closing user sessions
I'm using an Nginx server to host an PHP web application, and tried to upgrade its security by using some security headers, I've tested it on a staging environment and it works fine, so I've decided ...
0
votes
0
answers
145
views
Azure PHP8 exposing php code
My website runs fine BUT when i add ".PHP" in uppercase to my URL e.g. www.example.com/test.PHP my php code is exposed on the website source code.
I'm running PHP8 on azure.
My NGIX config ...
0
votes
0
answers
57
views
php files serving blank pages except for the login page on nginx
I have a project that has the root directory ed_v001 and all the includes and settings are in a directory ed_v001/includes.
When i open it in a browser it displays the login page properly but when you ...
1
vote
1
answer
2k
views
Nginx returning 404 on new installation
On Linux Mint 20.3 I had working setup for my local development of website:
server {
listen 80;
listen [::]:80;
server_name cbp.local;
root /home/gacek/html/cbp/public;
index ...
0
votes
1
answer
789
views
Is it possible to retrieve session values within the nginx config file?
just a quick question. I have a php webapp that sets a session cookie with values for username, isAdmin, etc. Is there any way that I could extract that information in the nginx config file?
...
1
vote
0
answers
143
views
Nginx - Server dead when received many requests
we have a large Woocommerce website hosted on Google VM servers (E2 4vCPU + 32 GB RAM + 100 GB SSD Storage), recently we created a mobile application using flutter and WordPress -Woocommerce- API, but ...
0
votes
0
answers
39
views
Which web server can return this page with empty html tags ? Cloudflare / Nginx / Apache
I am using a monitoring tool that constantly checks server status, and sometimes it gets this empty tags reply. The monitoring service doesn't give me more info, like status code.
<html><head&...
1
vote
1
answer
520
views
How to override Nginx response headers in PHP
I want to apply a default CSP header in nginx - basically a catch all. However, I also want to be able to override the CSP header via PHP in certain scripts. So far I've been unable to find a way to ...
0
votes
2
answers
249
views
NGINX config for the subdirectory app using Slim Framework
Need help editing the config below.
I have main site in / and another app (api) in the folder /api.
I'm using Slim Framework, so it has accesible index.php file in /api/public.
Now, I'm trying to be ...
0
votes
3
answers
646
views
CGI scripts: when can you return a document, instead of an HTTP response?
Script 1 below is bash, and is at https://example.com/cgi-bin/test. It produces the output 'Under construction' when fetched. It echos Status and Content-type headers, and some HTML. If I instead try ...
0
votes
1
answer
303
views
Error 502, phpinfo() directing to 7.4 when 8.1 is installed (File not found)
I'm setting up a web server. I have a freshly installed Ubuntu 22.04, Nginx (welcome page works), and php-fpm which installed php8.1 and php-fpm8.1.
To test PHP, I created a /var/www//info.php which ...
1
vote
0
answers
153
views
Change "Loaded Configuration File" for a specific domain [Not the entire server]
I do not want to make modifications to the default php.ini the server uses. I've made a new one to use, which is located in my site's own directory on an Nginx server. The issue I have come across is ...
0
votes
0
answers
296
views
Parse HTML as PHP on a Azure App Service (Linux) running PHP 8.1
I am really struggling to get an Azure App Service running Linux and PHP 8 or 8.1 to parse HTML files through PHP. The 8.0 and 8.1 versions run on nginx rather than Apache.
I have started by updating ...
0
votes
1
answer
653
views
Issue with 'mkdir(): No space left on device" in Docker Container. Might be some other issue though?
I have some docker containers (NGINX / PHP, MySQL, etc.) that have been running fine for years. However, recently I started seeing this error when running a PHP script in Laravel in the NGINX / PHP ...
0
votes
1
answer
196
views
Nginx Error after upgrading php
I have an aws server that runs some php code.
I recently upgraded to php8. Now when I access php pages on my site (for example https://whitewaterwriters.com/oracle/index.php) I get a nginx error.
I ...
0
votes
0
answers
209
views
Can't modify header Content-Type in PHP with Nginx
I have a
nginx/1.18.0 and
php-fpm 7.4.19 (fpm-fcgi)
PHP code header('Content-Type: text/css',true) doesn't modify the header,
the same for application/javascript or image/jpg,
files are sent with ...
1
vote
1
answer
1k
views
I get 404 error when trying interper PHP with Nginx in Docker
Sorry if this question is answered. It my first time using Docker in web dev.
Im setting up Nginx - PHP - MariaDB for my projects . And get stuck when my Nginx show 404 error when everytime i access ...
1
vote
1
answer
3k
views
CentOS 7 - upgrade PHP version from 7.2 to 8
CentOS 7
Nginx
Current websites run on PHP 7.2
PHP -v says
```# php -v
PHP 8.0.25 (cli) (built: Oct 25 2022 09:42:31) ( NTS gcc x86_64 )
Copyright (c) The PHP Group```
But phpinfo() in the nginx ...
0
votes
0
answers
133
views
how to stop nginx 302 error
I have a site with Ubuntu 20.04, php 8.1, and nginx 1.23.1. If I restart nginx and php-fpm I can login, browse the site, and everything works. If I wait a certain amount of time with no activity on ...
1
vote
0
answers
766
views
File not found Nginx PHP
I have an issue trying to create a separated demo location.
I have panel.example.com on /var/www/panel. I want panel.example.com/demo to lead to /var/www/demo.
I have the following configuration:
...
0
votes
1
answer
417
views
Nginx - fastcgi cache not working for rewrite enabled php page
I've been trying to figure out why Im failing to achieve fastcgi caching for a rewrite rule applied php page.
While all other request wonderfully cache, the rewrite ^(.+)/special/?$ /inc/special....
0
votes
1
answer
662
views
Nginx & multiple php-fpm version
I try to serve several sites based on different versions of PHP with Nginx & Ubuntu 20.04).
So I installed php-fpm versions 5.6 and 7.4 and configured Nginx like this:
server {
root /var/www;
...
1
vote
0
answers
127
views
File in Nginx alias location accessible, but PHP file_exists returns false
I add an alias location in Nginx. All files accessible in the browser but when I check in PHP file_exists return false.
My Nginx video location configuration:
location /videos {
alias D:/avan/film1;...
1
vote
0
answers
197
views
How to create multiple pools on LEMP Stack, PHP 8.1?
I need to optimize my web app performance, with that in mind I created two PHP-FPM pools for frontend and backend and their respective users. Both pools are listening to different sockets on /etc/php/...
0
votes
0
answers
179
views
how to write nginx rewrite rule to direct to another server that work on python
I have the following scenario
I have a domain name that is connected to machine X which has Nginx and PHP
I have multiple machines 1 to n who are not exposed public and only accessed by VPN ...
1
vote
0
answers
564
views
nginx 404 not found in subfolder
I installed a php script in /files/ subfolder on Nginx but when I access the page, it's not working. Just showing 404 not found.
I added this in the config but not working.
location ^~ /files {
if (!...
0
votes
1
answer
2k
views
PHP FPM cycles causing huge RAM consumption
A couple of ubuntu servers, using php8.0 / php8.1, with NGINX as a webserver, causing the problem, that my memory is filling up - based on the incoming traffic (req/s), so i have to restart the fpm ...
0
votes
0
answers
158
views
$_POST is empty when obtaining in "ErrorDocument 404" (nginx + apache + mod_php)
I try to transfer website from old server to new, and stucked with one problem. PHP/JS code on both servers is the same, but on new server it is not working - $_POST data are empty in AJAX-request.
...