i'm trying to configure a scalable symfony2 app, so i read this page https://cloud.google.com/compute/docs/load-balancing/http/cross-region-example
i did every thing like they said, is working with a simple nginx conf :
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
with that i get a positive check health and if i try http://ip_load_balancer i get the nginx's default page.
But when i try my real nginx's conf:
server {
listen 80;
server_name myapp-public.com;
root /usr/share/nginx/html/app-public/web;
recursive_error_pages off;
error_log /var/log/nginx/app_error.log;
access_log /var/log/nginx/app_access.log;
location / {
try_files $uri /app.php$is_args$args;
}
# PROD
location ~ ^/app\.php(/|$) {
internal;
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_intercept_errors on;
}
}
When i try http://ip_load_blancer, i get 502 Server Error. But when i try http://ip_vm1, i get my application (i open the http access from all to test).
Also all the check health fail. I don't really understand what's wrong, any idea?
Thanks.