error_log logs/error.log; pid run/nginx.pid; events { worker_connections 1024; } http { # allow long server names server_names_hash_bucket_size 64; include 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 logs/access.log; server_tokens off; sendfile on; keepalive_timeout 5; # spool uploads to disk instead of clobbering downstream servers client_body_temp_path spool/nginx-client-body 1 2; client_max_body_size 32m; client_body_buffer_size 128k; # proxy settings proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_max_temp_file_size 0; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; server { # Here define your prefered port number. listen 8888; # only matches ^/services urls and stops the location matching location ^~ /services/ { proxy_pass {{URL_TO_THE_SERVICES_SERVER}}; access_log logs/proxy.log main; } # match all the request location / { # Document root which should be configured to point to the directory # where we have the webapp root {{PATH_TO_YOUR_WWW_DIRECTORY}}; index index.html index.htm; } } }