Answer the question
In order to leave comments, you need to log in
How to fix "301 Moved Permanently" error on nginx (docker)?
Good afternoon,
please help me with a question on nginx in which I am a complete zero.
I'm trying to deploy nginx via docker so that I can later use it to upload files, but for some reason it doesn't work.
FROM nginx
COPY static-html-directory /usr/share/nginx/html
COPY static-html-directory/oam /usr/share/nginx/oam
COPY nginx.conf /usr/share/nginx/nginx.conf
worker_processes 1;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name 0.0.0.0;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /oam {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
}
Answer the question
In order to leave comments, you need to log in
The problem is in the Nginx config.
"location /oam" around here somewhere ;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question