LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-28-2013, 04:55 AM   #1
Orangutanklaus
Member
 
Registered: May 2006
Posts: 93

Rep: Reputation: 15
SSL termination via nginx for Tomcat backend


Hiho together,

I'm currently trying to implement a SSL termination for some Tomcat ASP server. I've decided to test various software and started with nginx under debian.

After a while I could get running nginx to handle normal HTTP communication. But when I switch to HTTPS the connection fails. For now I've made two site configurations, one for HTTP and one for HTTPS (for now it seems easier for me to get familiar with nginx). The /location part of both are the same while they differ slightly in the server configuration (HTTP vs. HTTPS). so here's the HTTPS configuraion:

PHP Code:
server {
  
listen 443;
  
ssl on;
  
server_name myhost.mydomain.de;
  
root /var/www/;
  
ssl_certificate      /etc/nginx/ssl/crt/myhost.mydomain.de.sub.class1.server.ca.crt;
  
ssl_certificate_key  /etc/nginx/ssl/key/myhost.mydomain.de.key;
  
ssl_ciphers               SSLv3+HIGH:RC4+MEDIUM:!aNULL:!eNULL:!3DES:!MD5:@STRENGTH;
  
ssl_prefer_server_ciphers on;
  
ssl_protocols             SSLv3;
  
ssl_session_cache         shared:SSL:10m;

  
location /context/ {
        
access_log /var/log/nginx/context_access_log;
        
error_log /var/log/nginx/context_error_log;
        
index index.html;
        
proxy_set_header X-Forwarded-Host $host;
        
proxy_set_header X-Forwarded-Server $host;
        
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        
proxy_pass http://tomcat-server:11080/;
        
proxy_redirect  http://tomcat-server:11080/ http://this-server:80/context/;

        
proxy_buffering off;
        
proxy_store     off;

        
proxy_connect_timeout 120;
        
proxy_send_timeout    120;
        
proxy_read_timeout    120;
 }

THe communication between NGINX and the Tomcat server should run over normal HTTP. When I open http://myhost.mydomain.de/context everything works fine. But with HTTPS it doesn't. I noticed in the log files that nginx adds the root path to the request. E.G. /app/xfire/connectionVerifyService becomes /var/www/app/xfire/connectionVerifyService

I don't understand this behaviour with HTTPS while with HTTP it doesn't happen.

Regards
OK

Last edited by Orangutanklaus; 02-28-2013 at 10:55 AM.
 
Old 03-01-2013, 08:13 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
Does following line require here ?

index index.html;

I think , / of root redirected to
proxy_pass / http://tomcat-server:11080/;

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSL termination dazdaz General 2 05-30-2012 05:22 PM
Nginx + Apache2 Backend - Timeout & Broken Pipe Hammad101 Linux - Server 1 02-18-2012 12:09 PM
Suppress Tomcat error pages using Nginx nikhil010586 Linux - Server 3 12-27-2010 02:19 PM
Apache ProxyPass + tomcat on backend with SSL alok.rhct Linux - Server 1 08-16-2009 07:47 AM
squid mapping requests to SSL backend server Dr_Death_UAE Linux - Server 0 12-29-2008 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration