Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    NGINX config for WebApp

    Kopano WebApp
    2
    3
    471
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cblaha
      cblaha last edited by

      Hi all,

      Hello everybody, I have big problems with the configuration of my NGinx server in connection with the WebApp. I use the following configuration in NGinx:

      location /webapp {
          alias /usr/share/kopano-webapp/;
          index index.php;
       
      location ~ /webapp/presence/ {
                  rewrite ^/webapp/presence(/.*)$ $1 break;
                  proxy_pass http://localhost:1234;
                  proxy_set_header Upgrade $http_upgrade;
                  proxy_set_header Connection "upgrade";
                  proxy_http_version 1.1;
                  }
      
      }
      
      location ~* ^/webapp/(.+\.php)$ {
          alias /usr/share/kopano-webapp/;
      
          # deny access to .htaccess files
          location ~ /\.ht {
                      deny all;
          }
      
      
          fastcgi_param PHP_VALUE "
              register_globals=off
              magic_quotes_gpc=off
              magic_quotes_runtime=off
              post_max_size=31M
              upload_max_filesize=30M
          ";
          fastcgi_param PHP_VALUE "post_max_size=31M
                   upload_max_filesize=30M
                   max_execution_time=3660
          ";
      
          include fastcgi_params;
          fastcgi_index index.php;
          #fastcgi_param HTTPS on;
          fastcgi_param SCRIPT_FILENAME $document_root$1;
          fastcgi_pass php-handler;
          access_log /var/log/nginx/kopano-webapp-access.log;
          error_log /var/log/nginx/kopano-webapp-error.log;
      
          # CSS and Javascript
          location ~* \.(?:css|js)$ {
              expires 1y;
              access_log off;
              add_header Cache-Control "public";
          }
      
          # All (static) resources set to 2 months expiration time.
          location ~* \.(?:jpg|gif|png)$ {
              expires 2M;
              access_log off;
              add_header Cache-Control "public";
          }
      
          # enable gzip compression
          gzip on;
          gzip_min_length  1100;
          gzip_buffers  4 32k;
          gzip_types    text/plain application/x-javascript text/xml text/css application/json;
          gzip_vary on;
          }
      

      When I call the WebApp I get the following error in error.log:

      2019/11/22 20:49:42 [error] 29201#29201: *414 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.120.13, server: server.xxxx.yyyy.de, request: "GET /webapp/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "server.xxxx.yyyy.de"
      

      Can anyone help me here?

      1 Reply Last reply Reply Quote 0
      • robing
        robing Kopano (Inactive) last edited by

        @cblaha

        Does nginx have enough permissions to use the php socket (/run/php/php7.3-fpm.sock)

        Regards Robin,

        Need support?
        Have a look at https://kopano.com/support/ for options.

        Helpful resources:
        https://kopano.com/blog/how-to-get-kopano/
        https://documentation.kopano.io/
        https://kb.kopano.io/

        1 Reply Last reply Reply Quote 0
        • cblaha
          cblaha last edited by

          @robing : I will check it. Thanks for your feedback

          1 Reply Last reply Reply Quote 0
          • First post
            Last post