joglomedia / LEMPer

LEMPer Stack is terminal-based LEMP / LNMP ( Linux, Nginx, MariaDB, PostgreSQL, MongoDB, Redis, Memcache, PHP, Secure FTP ) auto installer and virtual host manager for Debian & Ubuntu cloud or virtual server (vps) and on-premise (bare metal).
https://lemper.cloud/
GNU General Public License v3.0
208 stars 56 forks source link

[Improvement] Nginx doesn't forward the `HTTP_X_FORWARDED_PROTO` and `HTTPS` header #141

Closed joglomedia closed 1 year ago

joglomedia commented 2 years ago

Describe the Issue / Bug A clear and concise description of what the issue / bug is.

PHP application behind NGINX is unable to detect that HTTP_X_FORWARDED_PROTO or HTTPS secure connection is used. It seems that NGINX fastcgi params aren't set.

To Reproduce Steps to reproduce the behavior:

  1. Install LEMPer
  2. Add new site
  3. Enable SSL
  4. Use this SERVER params to test
<?php
echo "$_SERVER['HTTP_X_FORWARDED_PROTO']";
echo "$_SERVER['HTTPS']";

Expected Behavior A clear and concise description of what you expected to happen.

$_SERVER['HTTP_X_FORWARDED_PROTO'] should return https, and $_SERVER['HTTPS'] should return on

Screenshots / Screen Cast If applicable, add screenshots / screen cast to help explain your problem.

Config File (.env) If applicable, add part of your non-sensitive data from configuration file (.env).

System Information (please complete the following information):

Additional Context Add any other context about the problem here.

joglomedia commented 1 year ago

Commit https://github.com/joglomedia/LEMPer/commit/4dc269392a3759a97ad3c63742ca401933646577#diff-8578440da3e016a838a6530425ffa3769efaa617165838786f5609d7d3bb49bd , https://github.com/joglomedia/LEMPer/commit/4dc269392a3759a97ad3c63742ca401933646577#diff-9b27a51b21037e7bc4d351276e508788998d38fbadef851ccd65e340887043a6