𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘
𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
It indeed works now!
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
ohhhhhh
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
I have tried many things, still nothing works,
worker_processes auto;
daemon off;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
keepalive_timeout 65;

server {
listen 0.0.0.0:80;
listen [::]:80;
server_name localhost;

root /app/public;
index index.php index.html;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
worker_processes auto;
daemon off;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
keepalive_timeout 65;

server {
listen 0.0.0.0:80;
listen [::]:80;
server_name localhost;

root /app/public;
index index.php index.html;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
😭
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
brb, ping me when needed!
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
my latest change:
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
include mime.types; #works
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT}; # <- throws error
listen [::]:${PORT}; # <- prob also throws error if line is reached
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params; # <- this one broken?
include $!{nginx}/conf/fastcgi.conf; # <- this one maybe broken aswell
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
include mime.types; #works
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT}; # <- throws error
listen [::]:${PORT}; # <- prob also throws error if line is reached
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params; # <- this one broken?
include $!{nginx}/conf/fastcgi.conf; # <- this one maybe broken aswell
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
but how do I asign the random port each time?
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
I fixed the mime.types by using a custom one in the root dir and pointing to that
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
I think the placeholders dont get updated?
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
this also gave me errors
include $!{nginx}/conf/mime.types;
include $!{nginx}/conf/mime.types;
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
nginx: [emerg] host not found in "${PORT}" of the "listen" directive in /app/nginx.conf:25
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
@Brody
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
Is under
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}
in
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
#include $!{nginx}/conf/mime.types;
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
#include $!{nginx}/conf/mime.types;
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
31 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
@Brody doesnt work, even the template nginx.conf https://github.com/railwayapp/nixpacks/blob/main/src/providers/php/nginx.template.conf
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
include $!{nginx}/conf/mime.types;
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
worker_processes 5;
daemon off;

worker_rlimit_nofile 8192;

events {
worker_connections 4096; # Default: 1024
}

http {
include $!{nginx}/conf/mime.types;
index index.html index.htm index.php;

default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout;
error_log /dev/stdout;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts

server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;

$if(NIXPACKS_PHP_ROOT_DIR) (
root ${NIXPACKS_PHP_ROOT_DIR};
) else (
root /app;
)

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

$if(IS_LARAVEL) (
location / {
try_files $uri $uri/ /index.php?$query_string;
}
) else ()

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

$if(IS_LARAVEL) (
error_page 404 /index.php;
) else ()

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include $!{nginx}/conf/fastcgi_params;
include $!{nginx}/conf/fastcgi.conf;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
}
31 replies
RRailway
Created by zerosodium on 6/2/2023 in #βœ‹ο½œhelp
NX Monorepo with Railway
as it compiles/translates it to javascript
27 replies
RRailway
Created by zerosodium on 6/2/2023 in #βœ‹ο½œhelp
NX Monorepo with Railway
could you investigate the compiled javascript?
27 replies
RRailway
Created by zerosodium on 6/2/2023 in #βœ‹ο½œhelp
NX Monorepo with Railway
I am not sure why this is happening, I never had this (probrably because I have a laravel project with Vue), but still quite weird because in the times I did use TS I never had that type of error
27 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
31 replies
RRailway
Created by zerosodium on 6/2/2023 in #βœ‹ο½œhelp
NX Monorepo with Railway
It might actually does, as there might be a default generated at deployment
27 replies
RRailway
Created by 𝔾𝕦𝕀π•₯𝕒𝕧𝕠 π•Šπ•”π•™π•šπ•‘ on 6/2/2023 in #βœ‹ο½œhelp
NGINX invalid gateway 502, upstream sent too big header
I will mark this resolved unless it didnt fix it! πŸ‘
31 replies