Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx configuration when running WPT Server inside a Docker container #1150

Closed
misterbracket opened this issue Jun 6, 2018 · 1 comment
Closed
Labels

Comments

@misterbracket
Copy link

misterbracket commented Jun 6, 2018

Hi,
I have an issues that I am not able to solve.

I installed the WPT Server as a Docker Container and so far everything works well. After that I wanted to install a nginx webserver in front of my WPT, because I needed it to ask for authentication before you access the site and I wanted to do the SSL termination.


user www-data; worker_processes auto; pid /run/nginx.pid; events {
         worker_connections 768;
         # multi_accept on;
 }
 http {
         ##
         # Basic Settings
         ##
         sendfile on;
         tcp_nopush on;
         tcp_nodelay on;
         keepalive_timeout 65;
         types_hash_max_size 2048;
         # server_tokens off; server_names_hash_bucket_size 64; server_name_in_redirect off;
         include /etc/nginx/mime.types;
         default_type application/octet-stream;
         server_names_hash_bucket_size 64;
 
 ##
         # SSL Settings
         ##
         ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
         ssl_prefer_server_ciphers on;
         ##
         # Logging Settings
         ##
         access_log /var/log/nginx/access.log;
         error_log /var/log/nginx/error.log;
         ##
         # Gzip Settings
         ##
         gzip on;
         gzip_disable "msie6";
         # gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss
         gzip_types  text/plain application/xml application/xhtml+xml text/xml text/css text/javascript application/javascript application/x-javascript application/json image/x-icon;
         gzip_vary   on;
 
         # text/javascript;
         ##
         # Virtual Host Configs
         ##
         include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*;
 
 }
server {
    listen 80 ;
    listen [::]:80 ;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html index.php;
    server_name XXXXXXXXX;
    location / {
          try_files $uri $uri/ =404;
    }
    return 301 https://$server_name$request_uri;
}
server {
    listen 443 ssl;
    server_name XXXXXXXXX;
    ssl on;
    ssl_certificate /etc/nginx/sslcert.crt;
    ssl_certificate_key /etc/nginx/sslcert.key;
    location / {


        proxy_pass http://ups_wpt;
        auth_basic "wpt";
        auth_basic_user_file /etc/nginx/.htpasswd_wpt;
    }
 }
upstream ups_wpt {
    server 127.0.0.1:5555;
}

The configuration essentially works and I can access the site. What does not work is when I try to access one of the results in the history then the redirect does not work. It redirects me to https://ups_wpt/results.php.
image

Can someone post a sample config please?

@github-actions
Copy link

We're in the process of cleaning up issues on this project in order to ensure we're able to stay on top of high priority bugs and feature requests. As a part of this process, we're automatically closing any issues that have had no activity within the last two years, including this one, since the codebase has changed dramatically in that time. If you feel this is still relevant, please file a new issue using the relevant issue template so we can get it prioritized. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants