Browse Source

config elta before bourget

master
barry 6 years ago
parent
commit
169e7ed1e1
6 changed files with 241 additions and 30 deletions
  1. 20
      srv/conf/conf.d/portal.conf
  2. 40
      srv/conf/dnsmasq.conf
  3. 10
      srv/docker-compose.yml
  4. 195
      srv/nginx.airsas.conf
  5. 2
      srv/webapp/portal/index.html
  6. 4
      srv/webapp/portal/ready.html

20
srv/conf/conf.d/portal.conf

@ -1,22 +1,26 @@
server { server {
server_name captive.eca.aero server_name captive.eca.aero
*.apple.com *.apple.com
*.google.com
*.gstatic.com;
*.gstatic.com
*.firefox.com
*.ubuntu.com
*.google.com
*.android.com
*.gnome.org;
location / { location / {
proxy_pass http://pxportal_service:8889/; proxy_pass http://pxportal_service:8889/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Real-Ip $remote_addr;
proxy_buffering off; proxy_buffering off;
} }
} }
server {
listen 80 default_server;
server_name _ eca.aero;
root /data/webapp/default;
}
#server {
# listen 80 default_server;
# server_name _ eca.aero;
# root /data/webapp/default;
#}
server { server {
server_name portal.eca.aero; server_name portal.eca.aero;

40
srv/conf/dnsmasq.conf

@ -43,22 +43,34 @@ server=8.8.4.4
# increase dns cache form 512 to 4096 # increase dns cache form 512 to 4096
cache-size=4096 cache-size=4096
# Add domains which you want to force to an IP address here. # Add domains which you want to force to an IP address here.
address=/eca.aero/192.168.0.2
address=/.eca.aero/192.168.0.2
address=/eca.aero/10.0.0.254
address=/.eca.aero/10.0.0.254
address=/ife.aero/192.168.0.2
address=/.ife.aero/192.168.0.2
address=/pxcom.aero/192.168.0.2
address=/.pxcom.aero/192.168.0.2
address=/ife.aero/10.0.0.254
address=/.ife.aero/10.0.0.254
address=/pxcom.aero/10.0.0.254
address=/.pxcom.aero/10.0.0.254
address=/google.com/192.168.0.2
address=/.google.com/192.168.0.2
address=/gstatic.com/192.168.0.2
address=/.gstatic.com/192.168.0.2
address=/apple.com/192.168.0.2
address=/.apple.com/192.168.0.2
address=/google.com/10.0.0.254
address=/.google.com/10.0.0.254
address=/gstatic.com/10.0.0.254
address=/.gstatic.com/10.0.0.254
address=/android.com/10.0.0.254
address=/.android.com/10.0.0.254
# address=/#/192.168.0.2
address=/apple.com/10.0.0.254
address=/.apple.com/10.0.0.254
address=/firefox.com/10.0.0.254
address=/.firefox.com/10.0.0.254
address=/ubuntu.com/10.0.0.254
address=/.ubuntu.com/10.0.0.254
address=/gnome.org/10.0.0.254
address=/.gnome.org/10.0.0.254
address=/#/10.0.0.254
######### dhcp ########## ######### dhcp ##########
# Add local-only domains here, queries in these domains are answered # Add local-only domains here, queries in these domains are answered
@ -70,7 +82,7 @@ expand-hosts
# adds my localdomain to each dhcp host # adds my localdomain to each dhcp host
domain=eca.aero domain=eca.aero
# my private dhcp range + subnetmask + 14d lease time # my private dhcp range + subnetmask + 14d lease time
dhcp-range=192.168.0.10,192.168.0.200,255.255.255.0,14d
dhcp-range=10.0.0.20,10.0.0.220,255.255.255.0,14d
dhcp-option-force=160,"http://portal.eca.aero" dhcp-option-force=160,"http://portal.eca.aero"
# set route to my local network router # set route to my local network router
#dhcp-option=option:router,192.168.178.1 #dhcp-option=option:router,192.168.178.1

10
srv/docker-compose.yml

@ -1,4 +1,4 @@
version: '3'
version: '2'
services: services:
nginx: nginx:
@ -7,12 +7,12 @@ services:
networks: networks:
- pxportal - pxportal
ports: ports:
- "80:80"
- "8031:80"
volumes: volumes:
- ./webapp:/data/webapp - ./webapp:/data/webapp
- ./conf/nginx.conf:/etc/nginx/nginx.conf - ./conf/nginx.conf:/etc/nginx/nginx.conf
- ./conf/conf.d:/etc/nginx/conf.d/ - ./conf/conf.d:/etc/nginx/conf.d/
command: ['nginx-debug', '-g', 'daemon off;']
# command: ['nginx-debug', '-g', 'daemon off;']
dnsmasq: dnsmasq:
image: andyshinn/dnsmasq image: andyshinn/dnsmasq
@ -31,15 +31,15 @@ services:
container_name: pxportal_service container_name: pxportal_service
image: registry.preprod.pxcom.aero/pxcom-servers/pxportal-srv:latest image: registry.preprod.pxcom.aero/pxcom-servers/pxportal-srv:latest
volumes: volumes:
- ./webapp:/usr/app/webapp
- ssh:/root/.ssh - ssh:/root/.ssh
networks: networks:
- pxportal - pxportal
environment: environment:
- REDIRECT_TO=http://portal.eca.aero/index.html - REDIRECT_TO=http://portal.eca.aero/index.html
- ARP_CMD=ssh barry@172.27.0.1 arp -n
- ARP_CMD=ssh elta@172.21.0.1 arp -n
ports: ports:
- "8889:8889" - "8889:8889"
- "9000:9000"
volumes: volumes:
ssh: ssh:

195
srv/nginx.airsas.conf

@ -0,0 +1,195 @@
daemon off;
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
events {
worker_connections 1024;
# worker_processes and worker_connections allows you to calculate maxclients value:
# max_clients = worker_processes * worker_connections
}
http {
include mime.types;
# anything written in /opt/nginx/conf/mime.types is interpreted as if written inside the http { } block
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 logs/access.log main;
sendfile on;
# If serving locally stored static files, sendfile is essential to speed up the server,
# But if using as reverse proxy one can deactivate it
#tcp_nopush on;
# works opposite to tcp_nodelay. Instead of optimizing delays, it optimizes the amount of data sent at once.
#keepalive_timeout 0;
keepalive_timeout 65;
# timeout during which a keep-alive client connection will stay open.
gzip on;
# tells the server to use on-the-fly gzip compression.
server {
# You would want to make a separate file with its own server block for each virtual domain
# on your server and then include them.
listen 80;
#tells Nginx the hostname and the TCP port where it should listen for HTTP connections.
server_name localhost eca.aero ife.aero gom.aero;
# lets you doname-based virtual hosting
#access_log logs/host.access.log;
location /hotspot-detect.html {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_pass http://localhost:8889;
}
# Link to pxeasy
location /pxeasy/ {
proxy_pass http://localhost:23457;
}
location /logging/ {
proxy_pass http://localhost:23457;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
if ($http_user_agent ~ "^CaptiveNetworkSupport(.*)$") {
proxy_pass http://172.19.0.1:8031;
}
#The location setting lets you configure how nginx responds to requests for resources within the server.
root /var/www/html;
index index.html;
}
# Link to pxeasy
# location /pxeasy/ {
# proxy_pass http://localhost:23457;
# }
# location /logging/ {
# proxy_pass http://localhost:23457;
# }
#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 html;
#}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
}
# Default https
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/IFE_Cer.pem;
ssl_certificate_key /etc/nginx/IFE_Cer_key.pem;
location / {
root /var/www/html;
index index.html;
}
# PATCH waiting for certificate on pxeasy.ife.aero
location /pxeasy/ {
proxy_pass http://localhost:23457;
}
location /logging/ {
proxy_pass http://localhost:23457;
}
}
# PXEasy https
server {
listen 443;
server_name pxeasy.ife.aero;
ssl on;
ssl_certificate /etc/nginx/IFE_Cer.pem;
ssl_certificate_key /etc/nginx/IFE_Cer_key.pem;
location / {
proxy_pass http://localhost:23457;
}
}
# API to cabin crew server
server {
listen 443;
server_name api.ife.aero;
access_log api-https.access.log;
ssl on;
ssl_certificate /etc/nginx/IFE_Cer.pem;
ssl_certificate_key /etc/nginx/IFE_Cer_key.pem;
location /cabincrew/passengersannouncements/subscribe {
proxy_pass http://cabincrew-api:9001/cabincrew/passengersannouncements/subscribe;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 80 default_server;
server_name _;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_pass http://172.19.0.1:8031;
}
access_log captive-pxportal-access.log;
error_log captive-pxportal-error.log;
}
# CAPTIVE PORTAL
# server {
# listen 80;
# server_name
# *.firefox.com
# *.ubuntu.com
# *.google.com
# *.android.com
# *.gstatic.com
# *.apple.com
# *.gnome.org
# captive.eca.aero;
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Forwarded-Host $remote_addr;
# proxy_pass http://localhost:8889;
# }
# access_log captive-portal-access.log;
# error_log captive-portal-error.log;
# }
}

2
srv/webapp/portal/index.html

@ -121,7 +121,7 @@
<script> <script>
var K_NB_TRY = 4 var K_NB_TRY = 4
var K_HOME_URL = 'http://eca.aero'
var K_HOME_URL = 'http://portal.eca.aero/ready.html'
var K_VALIDATE_URL = 'http://captive.eca.aero/validate' var K_VALIDATE_URL = 'http://captive.eca.aero/validate'
function submitAction () { function submitAction () {

4
srv/webapp/portal/ready.html

@ -101,9 +101,9 @@
<INPUT TYPE="hidden" NAME="network_name" SIZE="64" MAXLENGTH="64" VALUE="Guest Network"> <INPUT TYPE="hidden" NAME="network_name" SIZE="64" MAXLENGTH="64" VALUE="Guest Network">
<div class="main"> <div class="main">
<div class="message"><span>We connect you simply!</span></div>
<div class="message"><span>Entertain yourself!</span></div>
<div class="connect"> <div class="connect">
<a href="http://google.com">
<a href="http://eca.aero">
<div class="connectButton"><span>Open portal</span></div> <div class="connectButton"><span>Open portal</span></div>
</a> </a>
</div> </div>

Loading…
Cancel
Save