Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #77 from att/messageSize/US133167/nginx_support_po…
Browse files Browse the repository at this point in the history
…st_requests

Message size/us133167/nginx support post requests
  • Loading branch information
yeudit authored Jan 24, 2024
2 parents 05dc594 + 9c7fa90 commit b85eaa3
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 2 deletions.
17 changes: 17 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM openquantumsafe/nginx:latest

ADD nginx.conf /opt/nginx/nginx-conf/nginx.conf
ADD app.js app.js
ADD start.sh start.sh

USER root

RUN apk add --update nodejs npm
RUN npm install express
RUN chmod +x start.sh

USER oqs



CMD ["./start.sh"]
13 changes: 13 additions & 0 deletions nginx/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const express = require('express');
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.get('/', function (req, res) {
res.send('Received POST request.\n');
});
app.post('/', function (req, res) {
res.send('Received GET request.');
});
app.listen(3000, function () {
console.log('app listening on port 3000');
});
67 changes: 67 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
worker_processes auto;


events {
worker_connections 1024;
}


http {
include ../conf/mime.types;
default_type application/octet-stream;


sendfile on;

keepalive_timeout 65;


server {
listen 8080;
server_name localhost;


location / {
root html;
index index.html index.htm;
}


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

}


# HTTPS server
#
server {
listen 0.0.0.0:4433 ssl;

access_log /opt/nginx/logs/access.log;
error_log /opt/nginx/logs/error.log;

ssl_certificate /opt/nginx/pki/server.crt;
ssl_certificate_key /opt/nginx/pki/server.key;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_protocols TLSv1.3;
# You could select a subset of supported KEMs from https://github.com/open-quantum-safe/liboqs#supported-algorithms
# Example (longer strings not supported by nginx!):
# ssl_ecdh_curve oqs_kem_default:frodo976shake:frodo1344shake:p256_kyber512:kyber768:kyber1024:ntru_hps2048509:ntru_hps2048677:ntru_hrss701:lightsaber:saber:kyber512:X25519;

# location / {
# root html;
# index index.html index.htm;
# }

location / {
proxy_pass http://localhost:3000;
}
}

}
3 changes: 3 additions & 0 deletions nginx/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
node app.js &
nginx -c /opt/nginx/nginx-conf/nginx.conf -g 'daemon off;'
2 changes: 1 addition & 1 deletion run/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
- "3306:3306"

nginx:
image: qujata/nginx:1.1.0
image: qujata/nginx:1.2.0
container_name: qujata-nginx
ports:
- 4433:4433
Expand Down
2 changes: 1 addition & 1 deletion run/kubernetes/charts/nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1
image:
repository: qujata/nginx
tag: "1.1.0"
tag: "1.2.0"
pullPolicy: Always


Expand Down

0 comments on commit b85eaa3

Please sign in to comment.