Error Code 502
bmask2020
FREEOP

10 months ago

I Have Error Status Code 502 i try to fixed it but not solving work

$10 Bounty

8 Replies

bmask2020
FREEOP

10 months ago

i need help to fix that error i set port as 8080 as the must be but not thing solve it


Status changed to Open nico • 10 months ago


You set the port to 8080 for the URL? or your app?


bmask2020
FREEOP

10 months ago

yes i set

listen 8080;
in railway-nginx.conf

Status changed to Open nico • 10 months ago


OP can also map the URL to the designated port via service settings.


bmask2020
FREEOP

10 months ago

I Added PORT Variable in Variable of App Service Value is 8080

but not work but not work yet

this is my railway-nginx.conf

server {
    listen 8080;
    server_name _;
    root /var/www/html/public;

    index index.php index.html;

    # Add server tokens off for security
    server_tokens off;

    #  gzip
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

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

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_buffering off;
        fastcgi_read_timeout 300;
    }

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

    # Store Static Files
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
        expires 30d;
        add_header Cache-Control "public, immutable";
    }
}

not also still give me error 502 when i try to domain on browser

bmask2020
FREEOP

10 months ago

that's my build log

[Region: europe-west4]

=========================

Using Detected Dockerfile

=========================

context: qvxn-CsRq

internal

load build definition from Dockerfile

0ms

internal

load metadata for docker.io/library/composer:latest

695ms

internal

load metadata for docker.io/library/php:8.2-fpm-alpine

696ms

auth

library/php:pull token for registry-1.docker.io

0ms

auth

library/composer:pull token for registry-1.docker.io

0ms

stage-0

FROM docker.io/library/php:8.2-fpm-alpine@sha256:370a4d6deb983afb28dd7dde6daf27870c983f81d83c81309f1f47efeb10d5e4

8ms

internal

load build context

0ms

FROM docker.io/library/composer:latest@sha256:8b4d59fde3bd505c5fef70c9f8d5c05e92af811fed037dad12869b373925ed31

9ms

stage-0

COPY . . cached

0ms

stage-0

COPY start.sh /start.sh cached

0ms

stage-0

COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-docker.conf cached

0ms

stage-0

COPY railway-nginx.conf /etc/nginx/http.d/default.conf.template cached

0ms

stage-0

RUN composer install --no-dev --optimize-autoloader --no-scripts --no-interaction cached

0ms

stage-0

RUN php artisan config:clear && php artisan route:clear && php artisan view:clear cached

0ms

stage-0

WORKDIR /var/www/html cached

0ms

stage-0

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer cached

0ms

stage-0

RUN apk update && apk add --no-cache nginx git curl libxml2-dev postgresql-dev zip unzip supervisor net-tools netcat-openbsd && docker-php-ext-install pdo pdo_pgsql bcmath opcache cached

0ms

stage-0

RUN chmod +x /start.sh cached

0ms

stage-0

RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache && chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache cached

0ms

stage-0

COPY composer.json composer.lock ./ cached

0ms

auth

sharing credentials for production-europe-west4-drams3a.railway-registry.com

0ms

importing to docker

7s

Build time: 9.91 seconds


bmask2020
FREEOP

10 months ago

i don't know why i still get that error status code 502


Status changed to Open brody • 10 months ago


bmask2020
FREEOP

10 months ago

here also deploy log Starting Container

Dropping all tables ........................................... 24.34ms DONE

INFO Running migrations.

0001_01_01_000000_create_users_table .......................... 42.93ms DONE

0001_01_01_000001_create_cache_table .......................... 28.50ms DONE

0001_01_01_000002_create_jobs_table ........................... 30.58ms DONE

INFO Preparing database.

Creating migration table ...................................... 17.14ms DONE


Welcome!

Sign in to your Railway account to join the conversation.

Loading...