Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Getting nginx's welcome page instead of rails home page

Hi i have created rails application(rails new railsapp). My docker file is

# Dockerfile

FROM ruby:2.7.0-alpine as builder

# Install dependencies for native extensions

RUN apk add --no-cache build-base libffi-dev
RUN apk add --no-cache sqlite-libs
RUN apk add --no-cache tzdata sqlite-dev
# This will be our application rootfolder

WORKDIR /application

# Copy all the content from current directory

COPY . /application

COPY Gemfile Gemfile.lock ./

# Build our application

RUN bundle install
RUN bundle exec rake

# Here we start a new stage
FROM nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /application/public /usr/share/nginx/html

I have built image by runnning docker image build -t railsapp . When i run ,

 docker container run -p 8888:80 railsapp

I get "welcome nginx page". I should get rails page.. But not displaying. I don't know what mistake I have made in docker file. I'm newbie to the docker. please someone help me. Thanks in advance.

nginx.conf

 server {
listen       80;
server_name  localhost;


location / {

// i don't know what to specify in the following directives. I have written the following code for react application.

    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri /index.html;                 
}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

}

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try to delete default nginx html file, or create your own nginx config file and specify path to your files

root /var/www/UI;
  try_files $uri $uri/ /index.html$is_args$args;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!