Ask questions about installing and configuring ProcessMaker 3
By msarboleda
#824189
Hello everyone :D
I am testing ProcessMaker Community 3.3.4 with Stack N225 and currently want to publish the web application to the Internet through my public address.

I have been able to access ProcessMaker through the public address and some of the header tabs work without being within the server network, however when I click the 'Designer' tab (being outside the server network), the application tries to communicate with an API on the ProcessMaker server and fails. I understand the logic of why someone outside can't connect to the application server, however I can't visualize how to design the scheme for ProcessMaker to work both on my local network and for other people on the internet.

Nginx Configuration
Code: Select all
#ProcessMaker HTTP Virtual Host
server {
  listen 80;
  listen [::]:80;
  # Change for server DNS name
  server_name 192.168.1.1;
  # The following line must be added Only if phpMyAdmin is configured
  # include /opt/phpMyAdmin/phpMyAdmin.conf;

  root /opt/processmaker/workflow/public_html; #where ProcessMaker is installed

  index index.html index.htm app.php index.php;

  try_files $uri $uri/ /index.php?$args;

  charset utf-8;

  location / {
    try_files $uri $uri/ /index.php?$query_string;

    #
    # Wide-open CORS config for nginx
    #
    if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Origin' '*';
        #
        # Om nom nom cookies
        #
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        #
        # Custom headers and headers various browsers *should* be OK with but aren't
        #
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
        #
        # Tell client that this pre-flight info is valid for 20 days
        #
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain charset=UTF-8';
        add_header 'Content-Length' 0;
        return 204;
     }
  }

  location = /favicon.ico { access_log off; log_not_found off; }

  location = /robots.txt  { access_log off; log_not_found off; }

  access_log /var/log/nginx/pm-access.log combined; #enables access logs

  error_log  /var/log/nginx/pm-error.log error; #enables error logs

  sendfile off;

  client_max_body_size 100m;

  # Every PHP script must be routed to PHP-FPM
  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php-fpm/processmaker.sock;
    fastcgi_index    app.php;

    include fastcgi_params;
    fastcgi_param    SCRIPT_FILENAME  /opt/processmaker/workflow/public_html/app.php;
    fastcgi_intercept_errors off;
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
  }

  # Browser Caching
  location ~* \.(ico|css|js|gif|jpeg|jpg|png|woff|ttf|otf|svg|woff2|eot)$ {
    expires 24h;
    add_header Cache-Control public;
    access_log off;
    log_not_found off;

    fastcgi_pass unix:/var/run/php-fpm/processmaker.sock;
    fastcgi_index    app.php;

    include fastcgi_params;
    fastcgi_param    SCRIPT_FILENAME  /opt/processmaker/workflow/public_html/app.php;
    fastcgi_intercept_errors off;
    fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
  }

  location ~ /\.ht {
    deny all;
  }

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

I show captures of requests being inside and outside the network.
Attachments
Inside network.jpg
Inside network.jpg (400.76 KiB) Viewed 17073 times
Outside network.jpg
Outside network.jpg (305.43 KiB) Viewed 17073 times
#824190
In Apache, you can create two virtualhosts. One for you local network and one with your public IP/domain name. I don't know anything about Nginx, but a couple minutes of Googling found this solution:
Code: Select all
server {
     listen 80
     server_name ~^192.168.0.1|mydomain.com$;
     root /opt/processmaker/workflow/public_html/ 
}
See: https://serverfault.com/questions/55543 ... e-location
If that doesn't work, you might have more luck asking on an Nginx forum.
#829496
amosbatto wrote: Tue Apr 30, 2019 8:28 pm In Apache, you can create two virtualhosts. One for you local network and one with your public IP/domain name. I don't know anything about Nginx, but a couple minutes of Googling found this solution:
Code: Select all
server {
     listen 80
     server_name ~^192.168.0.1|mydomain.com$;
     root /opt/processmaker/workflow/public_html/ 
}
See: https://serverfault.com/questions/555437/nginx-multiple-domain-point-to-same-location
If that doesn't work, you might have more luck asking on an Nginx forum.
Hello sir amosbatto,

i have same issue like it.

my lokal server access is http://10.123.1.1:8081 then access public nat into https://mybpms.mycompany.co.id.
we are using the bitnami windows (apache). Where the config and the config example.

1. when we access https://mybpms.mycompany.co.id, appear pop up login
https://i.postimg.cc/vBGgNRw1/post-to-forum.png
2. when access designer
https://i.postimg.cc/FK6jRy1r/post-to-forum2.png

this is my vhost config

<VirtualHost *:8081>
ServerName processmaker.example.com
ServerAlias www.processmaker.example.com
DocumentRoot "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/htdocs/workflow/public_html"

Include "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
ServerName processmaker.example.com
ServerAlias www.processmaker.example.com
DocumentRoot "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/htdocs/workflow/public_html"
SSLEngine on
SSLCertificateFile "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/conf/certs/server.crt"
SSLCertificateKeyFile "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/conf/certs/server.key"

Include "C:\Bitnami\processmaker-3.3.4-0/apps/processmaker/conf/httpd-app.conf"
</VirtualHost>

thx,

darma

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]