I am trying to run a TastyIgniter v3.0.4-beta.10 instance behind a HAProxy load balancer that redirects HTTP to HTTPS requests with redirect scheme https if !{ ssl_fc }
. My backend server, running Nginx 1.14.0 and PHP-FPM 7.2, listens on port 8080 for requests from the frontend. I'm getting a situation where all the static assets (css, images, forms) generated by Laravel are http://mydomain.com even though the 'url'
is set to https://mydomain.com
in /usr/share/nginx/html/config/app.php
.
This causes a mixed content error in Chrome and Firefox, so only the HTML loads when accessing TastyIgniter (nothing else).
Screenshot
Have attempted to rewrite all requests to HTTPS using a 302 redirect in the Nginx config file, which causes a redirect loop error.
For reference, here is a copy of my Nginx config file:
server {
listen 10.133.252.236:8080;
# listen [::]:80;
server_name mydomain.com;
root /usr/share/nginx/html;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
Looking forward to any help if you get a chance. Thanks in advance!