mail@pastecode.io avatar
6 months ago
1.6 kB
# auto detects a good number of processes to run
worker_processes auto;

#Provides the configuration file context in which the directives that affect connection processing are specified.
events {
    # Sets the maximum number of simultaneous connections that can be opened by a worker process.
    worker_connections 8000;
    # Tells the worker to accept multiple connections at a time
    multi_accept on;

http {
    # what times to include
    include       /etc/nginx/mime.types;
    # what is the default one
    default_type  application/octet-stream;

    # Sets the path, format, and configuration for a buffered log write
    log_format compression '$remote_addr - $remote_user [$time_local] '
        '"$request" $status $upstream_addr '
        '"$http_referer" "$http_user_agent"';

    server {
        # listen on port 80
        listen 8080;
        # save logs here
        access_log /var/log/nginx/access.log compression;

        gzip on;

        gzip_types text/plain application/javascript application/xml;

        gzip_min_length 10000;
        # where the root here
        root /app/dist/apps/dar-front;
        # what file to server as index
        index index.html index.htm;

        location /api {

        location / {
            etag on;
            add_header Cache-Control "public, max-age=0";
            # First attempt to serve request as file, then
            # as directory, then fall back to redirecting to index.html
            try_files $uri $uri/ /index.html;