Merge pull request #95 from helinko/fix-nginx-conf

Fix nginx config
Alexandre Dulaunoy 2020-11-16 08:52:00 +01:00 committed by GitHub
commit 33791f72b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 41 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
.env .env
data data
proxy/ssl/misp.crt
proxy/ssl/misp.key

View File

@ -4,12 +4,12 @@ services:
proxy: proxy:
build: build:
context: proxy context: proxy
container_name: proxy container_name: misp_proxy
restart: unless-stopped restart: unless-stopped
image: misp-proxy:latest image: misp-proxy:latest
ports: ports:
- 80:80 - 80:80
- 4443:443 - 443:443
web: web:
build: web build: web

View File

@ -1,11 +1,8 @@
FROM nginx:1.9 FROM nginx:1.18
# default conf for proxy service # default conf for proxy service
COPY ./default.conf /etc/nginx/conf.d/default.conf COPY ./default.conf /etc/nginx/conf.d/default.conf
# NOT FOUND response
COPY ./backend-not-found.html /var/www/html/backend-not-found.html
# Proxy and SSL configurations # Proxy and SSL configurations
COPY ./includes/ /etc/nginx/includes/ COPY ./includes/ /etc/nginx/includes/

View File

@ -1,6 +0,0 @@
<html>
<head><title>Proxy Backend Not Found</title></head>
<body >
<h2>Proxy Backend Not Found</h2>
</body>
</html>

View File

@ -1,12 +1,15 @@
# web service1 config. # plain http redirect to https
server { server {
listen 80; listen 80;
listen 443 ssl http2; listen [::]:80;
server_name web; server_name localhost;
return 301 https://$server_name$request_uri;
if ($scheme != "https") { }
rewrite ^ https://$host$uri permanent; # main server, reverse proxy to 'web' container
} server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name localhost;
# Path for SSL config/key/certificate # Path for SSL config/key/certificate
ssl_certificate /etc/ssl/certs/nginx/misp.crt; ssl_certificate /etc/ssl/certs/nginx/misp.crt;
@ -21,25 +24,3 @@ server {
access_log off; access_log off;
error_log /var/log/nginx/error.log error; error_log /var/log/nginx/error.log error;
} }
# Default
server {
listen 80 default_server;
server_name _;
root /var/www/html;
charset UTF-8;
error_page 404 /backend-not-found.html;
location = /backend-not-found.html {
allow all;
}
location / {
return 404;
}
access_log off;
log_not_found off;
error_log /var/log/nginx/error.log error;
}