ProxCP Web Sample VirtualHost Settings - Apache and Nginx

From ProxCP Documentation
Revision as of 10:55, 18 March 2019 by Proxcp (talk | contribs)

These are example VirtualHost configuration files for ProxCP Web. There is a sample file for Apache and Nginx web servers. Some configuration options here will need to be changed to fit your file paths and domains.

Apache

<VirtualHost *:443>

   ServerName proxcp.example.com
   DocumentRoot /var/www/proxcp.example.com/public_html
   ErrorLog /var/log/httpd/proxcp.example.com-error.log
   CustomLog /var/log/httpd/proxcp.example.com-access.log combined
   SSLEngine on
   SSLCertificateFile /etc/letsencrypt/live/proxcp.example.com/fullchain.pem
   SSLCertificateKeyFile /etc/letsencrypt/live/proxcp.example.com/privkey.pem

</VirtualHost>

Nginx

server {

   listen 443 ssl http2;
   listen [::]:443 ssl http2;
 
   server_name proxcp.example.com;
   set $base /var/www/proxcp.example.com;
   root $base/public_html;
 
   index index.html index.php;
     
   client_max_body_size 30m;
   server_tokens off;
 
   location ~ /\.ht {
       deny  all;
   }
  
   location ~ ^/\.user\.ini {
       deny all;
   }
  
   location = /favicon.ico {
       log_not_found off;
       access_log off;
   }
  
   location = /robots.txt {
       allow all;
       log_not_found off;
       access_log off;
   }
  
   location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
       expires max;
       log_not_found off;
   }
  
   # svg, fonts
   location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff|woff2)$ {
       add_header Access-Control-Allow-Origin "*";
       expires 7d;
       access_log off;
   }
 
   location ~ \.php$ {
       try_files                $uri =404;
       fastcgi_intercept_errors on;
       fastcgi_index            index.php;
       include                  fastcgi_params;
       fastcgi_param            SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_pass             php-fpm;
       fastcgi_read_timeout     180;
   }
 
   location / {
       try_files $uri $uri/ /$uri.php?$query_string;
   }
 
   access_log /var/log/nginx/proxcp.example.com-443-access.log;
   error_log /var/log/nginx/proxcp.example.com-443-error.log;
 
   ssl_certificate /etc/letsencrypt/live/proxcp.example.com/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/proxcp.example.com/privkey.pem;
   ssl_trusted_certificate /etc/letsencrypt/live/proxcp.example.com/fullchain.pem;

}

server {

   listen 80;
   listen [::]:80;
 
   server_name proxcp.example.com;
 
   location / {
       return 301 https://proxcp.example.com$request_uri;
   }

}

Nginx ISO Upload Settings - nginx.conf

location /files { try_files $uri $uri/ /server.php?$query_string; }