Hi All,

I'm trying to deploy Ofbiz on an ubuntu 16.04 VM on Azure.

I've got nginx, java version 1.8.0_161, and ofbiz 16.11 downloaded on the
VM. I can run nginx on the VM and see the welcome to Nginx page on my
browser, but I notice an error when running ./gradlew ofbiz (please see my
reply for the error) which I believe prevents me from reaching my ofbiz
instance with the browser.

Does anyone have any advice for me, or perhaps relevant reading material on
configuring ofbiz to go through nginx (also open to apache http server)?
Everything I've seen on user@ofbiz is either out of date, or leads to a
webpage that has been removed.

I ran the following lines to generate my ssl keys:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
openssl x509 -outform der -in cert.pem -out cert.der
keytool -genkey -keyalg RSA -alias ssl -keystore ofbizssl.jks
keytool -import -alias ssl -trustcacerts -file cert.der -keystore
ofbizssl.jks

I modified the following files:

>> framework/catalina/ofbiz-component.xml
under container catalina-container, I changed the default-host to my VM's
public IP (52.165.18.243) from 0.0.0.0
under container http-connector, I changed the address to my VM's public IP (
52.165.18.243) from 0.0.0.0, left port at 8080
under container https-connector, I changed the address to my VM's public IP
 (52.165.18.243) from 0.0.0.0, left port at 8443

>> framework/webapp/config/url.properties
port.https=443
port.http=80

>> etc/nginx/conf.d/ofbiz-ssl.conf
upstream ofbiz {
  server 52.165.18.243:8080;
  server 52.165.18.243:8080;
}

>> etc/nginx/conf.d/ofbiz-ssl.conf
upstream ofbiz-ssl {
  server 52.165.18.243:8443;
  server 52.165.18.243:8443;
}

>> etc/nginx/sites-available/ofbiz
server {
  server_name your.domain.name;
  listen 80;
#   if you have IPv6 support
  listen [::]:80;

#   ... // your custom settings can go here
#   include proxy_params;
#   proxy_set_header X-Forwarded-Proto $scheme;

  root /home/sean/ofbiz.16.11;

      location / {
        try_files $uri $uri/ @ofbiz;
    }

   location @ofbiz {
        proxy_pass http://ofbiz;

        proxy_read_timeout 180s;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
    }
}

server {
    # given a domain name, change 52.165.18.243 to my domain name
    # server_name your.domain.name;
  server_name 52.165.18.243;
  listen 443 ssl;
#   if you have IPv6 support
  listen [::]:443 ssl;

# your custom settings go here

#   include proxy_params;
#   proxy_set_header X-Forwarded-Proto $scheme;

    ssl_certificate /home/sean/cert.der;
    ssl_certificate_key /home/sean/key.pem;

  root /home/sean/ofbiz.16.11;

      location / {
        try_files $uri $uri/ @ofbiz;
    }

   location @ofbiz {
        proxy_pass https://ofbiz-ssl;

        proxy_read_timeout 180s;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
    }
}

Reply via email to