Skip to content
Snippets Groups Projects
Commit e5ecd977 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add nginx dockerfile and configuration

parent 3ae5e4e9
No related branches found
No related tags found
No related merge requests found
.gitlab-ci.yml
README.md
PythonServer
FROM nginx:1.16
# Change directories owwnership to start nginx as non root
RUN chown -R nginx /var/cache/nginx /var/log/nginx;
COPY nginx.conf /etc/nginx/
COPY default.conf /etc/nginx/conf.d/
COPY ./WebSites /usr/share/nginx/web/
USER nginx
server {
listen 8000 default_server;
location / {
root /usr/share/nginx/web/pos;
}
location ~ ^/(pvs|interlocks|instruments) {
root /usr/share/nginx/web;
}
location /dev {
alias /usr/share/nginx/web/pos-dev;
}
# static json and png data files
location ~ ^/data/.*\.(png|json)$ {
root /usr/share/nginx;
}
location /data {
rewrite /data/(.*)$ /$1 break;
proxy_pass http://pos_python_server:8080;
}
location /plot {
rewrite /plot/(.*)$ /$1 break;
proxy_pass http://archiver-01.tn.esss.lu.se:17668/;
}
#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;
}
}
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/cache/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"body_bytes_sent": $body_bytes_sent, '
'"request_time": $request_time, '
'"response_status": $status, '
'"request": "$request", '
'"request_method": "$request_method", '
'"host": "$host",'
'"upstream_cache_status": "$upstream_cache_status",'
'"upstream_addr": "$upstream_addr",'
'"http_x_forwarded_for": "$http_x_forwarded_for",'
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"http_version": "$server_protocol", '
'"nginx_access": true }';
access_log /var/log/nginx/access.log graylog2_json;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment