Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Sunday at 8:26 PM
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Saturday at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Jul 15, 2026
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Nginx server configuration problem
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="pasansnoop" data-source="post: 28035153" data-attributes="member: 125460"><p>machan is there anybody who knows how to configure nginx to use php on a server?</p><p>after doing everything, I get '502 Bad Gateway' error from the server <img src="/styles/default/xenforo/smilies/default/oo.gif" class="smilie" loading="lazy" alt=":oo:" title="Oo :oo:" data-shortname=":oo:" /> </p><p>i'm stuck for a day troubleshooting the error but couldn't find any..</p><p></p><p>this is the guide I followed> <a href="https://www.techsupportpk.com/2019/04/how-to-set-up-lemp-stack-ubuntu-1904.html" target="_blank">https://www.techsupportpk.com/2019/04/how-to-set-up-lemp-stack-ubuntu-1904.html</a></p><p></p><p>can you spot any fault in this config? (which I've linked to /etc/nginx/sites-enabled/)</p><p></p><p>[CODE=nginx]server {</p><p> listen 80;</p><p> root /var/www/html;</p><p> index index.php index.html index.htm index.nginx-debian.html;</p><p> server_name localhost;</p><p></p><p> location / {</p><p> try_files $uri $uri/ =404;</p><p> }</p><p></p><p> location ~ \.php$ {</p><p> include snippets/fastcgi-php.conf;</p><p> fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;</p><p> }</p><p></p><p> location ~ /\.ht {</p><p> deny all;</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="pasansnoop, post: 28035153, member: 125460"] machan is there anybody who knows how to configure nginx to use php on a server? after doing everything, I get '502 Bad Gateway' error from the server :oo: i'm stuck for a day troubleshooting the error but couldn't find any.. this is the guide I followed> [URL]https://www.techsupportpk.com/2019/04/how-to-set-up-lemp-stack-ubuntu-1904.html[/URL] can you spot any fault in this config? (which I've linked to /etc/nginx/sites-enabled/) [CODE=nginx]server { listen 80; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name localhost; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; } location ~ /\.ht { deny all; } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom