Eventuell möchten Sie lieber NGINX als Webserver verwenden. JobRouter stellt .htaccess-Dateien bereit, die Apache konfigurieren. Dies ist für NGINX nicht möglich, da dort eine von der Anwendung unabhängige Konfiguration vorgenommen werden muss. Im Nachfolgenden finden Sie eine beispielhafte nginx.conf-Datei mit allen relevanten Einstellungen analog zu den .htaccess-Dateien von Apache.
Bitte beachten Sie: Stellen Sie sicher, dass die Konfiguration auf Ihr System abgestimmt ist.
worker_processes auto;
pid /var/run/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /mnt/jobrouter/output/log/nginx/access.log main;
server_tokens off;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 100M;
client_body_buffer_size 100M;
server_names_hash_bucket_size 64;
server {
listen 443;
listen [::]:443;
real_ip_header X-Forwarded-For;
proxy_set_header X-Forwarded_Host $host;
set $realip $remote_addr;
if ($http_x_forwarded_for ~ "^(\d+\.\d+\.\d+\.\d+)") {
set $realip $1;
}
port_in_redirect off;
root /usr/share/nginx/html/jobrouter;
index index.php;
server_name ${SERVER_NAME};
error_log /mnt/jobrouter/output/log/nginx/error.log error;
location /nginx-health {
allow 127.0.0.1;
deny all;
access_log off;
log_not_found off;
return 200 "healthy\n";
}
location /nginx-status {
allow 127.0.0.1;
deny all;
access_log off;
log_not_found off;
stub_status;
}
location / {
try_files $uri $uri/ =404;
}
location /api/rest {
try_files $uri /api/rest/index.php$is_args$args;
}
location /api/jobarchivelink {
try_files $uri /api/jobarchivelink/index.php$is_args$args;
}
location /api/jobsign {
try_files $uri /api/jobsign/index.php$is_args$args;
}
location ~ ^/cache/ {
deny all;
}
location ~ ^/config/ {
deny all;
}
location ~ ^/export/ {
deny all;
}
location ~ ^/functions/ {
deny all;
}
location ~ ^/includes/ {
deny all;
}
location ~ ^/languages/ {
deny all;
}
location ~ ^/license/ {
deny all;
}
location ~ ^/notes/ {
deny all;
}
location ~ ^/output/ {
deny all;
}
location ~ ^/systemactivities/ {
deny all;
}
location ~ ^/templates/ {
deny all;
}
location ~ ^/uploads/ {
deny all;
}
location ~ ^/library/ {
deny all;
}
location ~ ^/setup/xml/ {
deny all;
}
location /assets/cache/ {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,X-Jobrouter-Client-Language' always;
rewrite /assets/cache/(\d+/)?([a-z]+)/(.+) /assets/fetch.php?directory=$2&filename=$3&$args;
}
location ~ \.php$ {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,X-Jobrouter-Client-Language' always;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param UNENCODED_URL $request_uri;
fastcgi_param REMOTE_ADDR $realip;
fastcgi_pass ${PHP_ENDPOINT}:9000;
fastcgi_read_timeout 600;
}
location ~ /\.ht {
deny all;
}
}
}