Code Monkey home page Code Monkey logo

nginxconfig.io's Introduction

GitHub stars GitHub contributors MIT License
Closed issues Closed PR Open issues Open PR

nginxconfig

โš™๏ธ NGINX configuration generator on steroids ๐Ÿ’‰

The only tool you'll ever need to configure your NGINX server.
do.co/nginxconfig ยป

Report a bug ยท Request a feature


โœจ NGINX Config

NGINX is so much more than just a webserver. You already knew that, probably.

We love NGINX, because:

  • Low memory usage
  • High concurrency
  • Asynchronous event-driven architecture
  • Load balancing
  • Reverse proxying
  • FastCGI support with caching (PHP)
  • Amazing fast handling of static files
  • TLS/SSL with SNI

A lot of features with corresponding configuration directives. You can deep dive into the NGINX documentation right now OR you can use this tool to check how NGINX works, observe how your inputs are affecting the output, and generate the best config for your specific use-case (in parallel you can also still use the docs).

๐Ÿš€ Usage

GOTO do.co/nginxconfig

Features: HTTPS, HTTP/2, IPv6, certbot, HSTS, security headers, SSL profiles, OCSP resolvers, caching, gzip, brotli, fallback routing, reverse proxy, www/non-www redirect, CDN, PHP (TCP/socket, WordPress, Drupal, Magento, Joomla), Node.js support, Python (Django) server, etc.

๐Ÿ‘จโ€๐Ÿ’ป Author

Rewrite & Maintenance

Matt (IPv4) Cowley <[email protected]> (https://mattcowley.co.uk)

Original version

Bรกlint Szekeres <[email protected]> (https://balint.szekeres.me)

โ–ถ๏ธ Development

  1. Clone the repository

    git clone https://github.com/digitalocean/nginxconfig.io.git
  2. Install NPM packages

    npm ci
  3. Run the development server (with file watchers)

    npm run dev
  4. Open the development site localhost:8080

  5. Lint your code (eslint & stylelint)

    npm test
  6. Build for production (to the dist directory)

    npm run build

๐Ÿค Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

โš’๏ธ Built With

  • Vue.js - Template handling & app generation
  • Bulma - Base styling, customised by do-bulma
  • Prism - Bash & NGINX syntax highlighting

๐Ÿ“š Resources

โญ๏ธ Show your support

Give a โญ๏ธ if this project helped you!

๐Ÿ“ License

Copyright ยฉ 2020 DigitalOcean, Inc <[email protected]> (https://www.digitalocean.com).
This project is licensed under the MIT license.

nginxconfig.io's People

Contributors

2ndkauboy avatar 5idereal avatar a21ns1g4ts avatar aihowes avatar alexmanno avatar amnotadev avatar clivern avatar dependabot[bot] avatar doggy8088 avatar goodmost avatar jcgoette avatar maskeynihal avatar mattipv4 avatar moniang avatar mphschmitt avatar mrjmpl3 avatar nadir avatar niklasdah avatar noobtw avatar pidpawel avatar powerdot avatar raulsoledispa avatar roki100 avatar rytoex avatar saidatom avatar sve1r avatar walshydev avatar williamchang80 avatar xopez avatar yasionfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginxconfig.io's Issues

Add a "www" version in "HTTP Redirect" server block

The "HTTP Redirect" block is missing a "www.example.com" version of the domain. I've encountered problems on redirecting without it.

server_name .{{ domain() }};<!--

It could be something like this: (but is needed to verify if the "www" is checked)

server_name .{{ domain() }} www.{{ domain() }};<!--

File: public/templates/conf/sites-available/example.com.conf.html
Line: 200

Single-file config

Hello. I see in a new version single-file config option is removed? But for what reasons?

Make config generation API driven

Is there an intention to create an API to enable generating the config automatically?

That will help much with provisioning tools.

Feature request: Support for Statamic CMS

As I've been thrown into the role as system administrator I was thrilled to find nginxconfig.io to help me out with a rock solid WP config. I would very much like to see a version for the rising Statamic CMS as well. Is there any way that could happen?

NGINX version

Greetings.

Is this config generator works on the 1.15.X version of NGINX?

(Sorry for mu bad English)

Drupal Private files missing configuration

When Drupal is configured to use private files, those files should be served by Drupal and not NGINX directly.
# Handle private files through Drupal. Private file's path can come # with a language prefix. location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 try_files $uri /index.php?$query_string; }

TLSv1 TLSv1.1 Deprecated

Site Main Example code use TLSv1(June 18, 2018, Deprecated ) TLSv1.1((December 20, 2018, Soon)

https://tools.ietf.org/id/draft-moriarty-tls-oldversions-diediedie-00.html

# Generated by nginxconfig.io

user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;

events {
	multi_accept on;
	worker_connections 65535;
}

http {
	charset utf-8;
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	server_tokens off;
	log_not_found off;
	types_hash_max_size 2048;
	client_max_body_size 16M;

	# MIME
	include mime.types;
	default_type application/octet-stream;

	# logging
	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log warn;

	# SSL
	ssl_session_timeout 1d;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;

	# Diffie-Hellman parameter for DHE ciphersuites
	ssl_dhparam /etc/nginx/dhparam.pem;

	# intermediate configuration
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
	ssl_prefer_server_ciphers on;

	# OCSP Stapling
	ssl_stapling on;
	ssl_stapling_verify on;
	resolver 1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
	resolver_timeout 2s;

	# load configs
	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

proxy.conf not shown but referenced

Hello and thanks for this awesome project.

Currently when you select something with a reverse proxy (eg: https://nginxconfig.io/?0.php=false&0.proxy&client_max_body_size=41 ) you get this snipped in your example.com.conf:

# reverse proxy
	location / {
		proxy_pass http://127.0.0.1:3000;
		include nginxconfig.io/proxy.conf;
	}

But the config file include nginxconfig.io/proxy.conf is not displayed. Worked a (few) week(s) ago but not anymore.

Also I don't get any JS errors, have enabled and disabled an adblocker and tried it on latest Chrome on Windows and lates Chromium on Linux

Proxied content not transferring images,css,js,audio,video files because of general.conf

Hello, I had a strange problem and finally figured it out.

Problem

When I use the configuration to proxy content like with this configuration: https://nginxconfig.io/?0.domain=192.168.1.198&0.https=false&0.php=false&0.proxy&0.proxy_pass=http:%2F%2F192.168.1.119:8080%2F&user=nginx&pid=%2Frun%2Fnginx%2Fnginx.pid&client_max_body_size=100

My page looks like this:

But when I go to the /etc/nginx/nginxconfig.io/general.conf and comment out these parts:

# assets, media
location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$
{
        expires 7d;
        access_log off;
}

# svg, fonts
location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
        add_header Access-Control-Allow-Origin "*";
        expires 7d;
        access_log off;
}

then it works

The reason for this is, that the "location" settings will just be appended to the .conf file of the site.

Which means, if these location blocks don't also have the proxy pass lines (which doesn't even work at the moment see #57 ) the site won't forward any images,etc.

Solution

When user specifies that they want to use a proxy, the cache directives will have to be added to the server block (after the inclusion of general.conf) and will have to include the proxy pass thing. like so:

server {
	listen 80;
	listen [::]:80;

	server_name 192.168.1.198;

	# reverse proxy
	location / {
		proxy_pass http://192.168.1.119:8080/;
		include nginxconfig.io/proxy.conf;
	}
    include nginxconfig.io/general.conf;

    # assets, media
    location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
        expires 7d;
        access_log off;
        proxy_pass http://192.168.1.119:8080/;
        include nginxconfig.io/proxy.conf;
    }

    # svg, fonts
    location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
        add_header Access-Control-Allow-Origin "*";
        expires 7d;
        access_log off;
        proxy_pass http://192.168.1.119:8080/;
        include nginxconfig.io/proxy.conf;
    }

	
}

Wrong regex in nginxconfig.io/wordpress.conf

Please check this regex in nginxconfig.io/wordpress.conf

# WordPress: deny wp-content/plugins nasty stuff location ~* ^/wp-content/plugins/.*\.(?!css(\.map)?|js(\.map)?...) { deny all; }

/wp-content/plugins/responsive-lightbox/assets/swipebox/css/swipebox.css --> ALLOW
/wp-content/plugins/responsive-lightbox/assets/swipebox/css/swipebox.min.css --> DENY
/wp-content/plugins/responsive-lightbox/assets/swipebox/js/jquery.swipebox.js --> DENY
/wp-content/plugins/responsive-lightbox/assets/swipebox/js/jquery.swipebox.min.js --> DENY

It means:

/wp-content/plugins/xxx.{allow_extension} --> OK
/wp-content/plugins/xxx.yyy.{allow_extension} --> Not working

html being rendered inside a 'pre' tag when 'X-Content-Type-Options "nosniff" always' is enabled

This is happening in Chrome 64 and Epiphany 3.26. However it is not happening in Firefox 58. I'm using nginx:latest and php:fpm inside of Docker.

'X-Content-Type-Options "nosniff" always' is enabled:
screenshot from 2018-03-05 15-45-36

'X-Content-Type-Options "nosniff" always' is disabled:
screenshot from 2018-03-05 15-46-36

This is my /etc/nginx/conf.d/default.conf (really the only modification I made was to "fastcgi_pass"):

server {
    listen 80;
    listen [::]:80;

    server_name localhost;
    set $base /var/www/html;
    root $base/public;

    # index
    index index.php;

    # $uri, index.php
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # security headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer-when-downgrade" always;
    add_header Content-Security-Policy "default-src * 'unsafe-eval' 'unsafe-inline'" always;
    
    # . files
    location ~ /\. {
        deny all;
    }
    
    # assets, media
    location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
        expires 7d;
        access_log off;
    }
    
    # svg, fonts
    location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff|woff2)$ {
        add_header Access-Control-Allow-Origin "*";
        expires 7d;
        access_log off;
    }
    
    # gzip
    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

    # handle .php
    location ~ \.php$ {
        try_files $uri =404;
        
        # fastcgi
        #fastcgi_pass                unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_pass                php:9000;
        fastcgi_index               index.php;
        fastcgi_split_path_info     ^(.+\.php)(/.+)$;
        fastcgi_param               SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param               PHP_ADMIN_VALUE open_basedir=$base/:/usr/lib/php/:/tmp/;
        fastcgi_intercept_errors    off;
        
        fastcgi_buffer_size             128k;
        fastcgi_buffers                 256 16k;
        fastcgi_busy_buffers_size       256k;
        fastcgi_temp_file_write_size    256k;
        
        # default fastcgi_params
        include fastcgi_params;
    }
}

# subdomains redirect
server {
    listen 80;
    listen [::]:80;

    server_name *.localhost;

    return 301 https://localhost$request_uri;
}

Feature request: IP binding

I'd love to see support for Nginx servers binding to specific IPs for servers that have more than one IP. I know this is super simple to do after the general configuration files have been generated, but it may prove useful for people that may not be sure how to do it.

[Feature Request] NGINX conf optimized for docker deployment

NGINX publishes container images in Docker hub that includes default configuration and layout:
https://github.com/nginxinc/docker-nginx/tree/master/mainline/alpine

The default configuration of the containers differs in subtle ways; like user being nginx, pid being /var/run/nginx.pid; etc. I realize this tool provides sections to setup these values and thus match the values in container. However, I was wondering whether the tool could have out-of-the-box support for configuration to be put in the Docker container image. Perhaps a checkbox in 'Tools' section that indicates that deployment will be via Docker. If checked, the recommended configuration could be optimized for docker deployments.

ZIP files

Create a downloadable package from generated config files.

PHP path info does not work

In php_fastcgi.conf there is this rule fastcgi_split_path_info ^(.+\.php)(/.+)$; which does not work because the location regex only matches \.php$.

It will be more useful to match [^/]\.php(/|$) in the location regex.

conflicting server name on 0.0.0.0:80 ignored

After I added config generated by the website to my site-available/domain.conf file I get the following warnings.

nginx: [warn] conflicting server name ".domain.com" on 0.0.0.0:80, ignored

Here's my domain.com conf file

server {
    listen 443 ssl http2;
	listen [::]:443 ssl http2;

    server_name domain.com;


    access_log /var/log/nginx/domain.com.access.log rt_cache;
    error_log /var/log/nginx/domain.com.error.log;


    root /var/www/domain.com/htdocs;

    index index.php index.html index.htm;


    include common/wpfc-php7.conf;  
    
    include common/wpcommon-php7.conf;
    include common/locations-php7.conf;
    include /var/www/domain.com/conf/nginx/*.conf;
}

# subdomains redirect
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	server_name *.domain.com;

	return 301 https://domain.com$request_uri;
}

# HTTP redirect
server {
	listen 80;
	listen [::]:80;

	server_name .domain.com;

	location / {
		return 301 https://domain.com$request_uri;
	}
}

This is happening to all my website where I used a similar configuration.

Let me know if I'm missing something.

Cache-Control immutable

Browser Support

# add_header Cache-Control "public,max-age=3600,immutable";
# add_header Cache-Control "public,max-age=604800,immutable";
# add_header Cache-Control "public,max-age=31536000,immutable";

Add multiple sites support

Would be great to have a single button support for let's encrypt configuration.

Would also be great to allow multiple site on the same page. Just click add to add another site into the multi-sites config.

Thanks for this!

Define logs in server block

If I knew how to do this I would do a PR instead of creating an issue

When using a separated file structure it is best to define the log path to be specific to that domain.

For example;

access_log /var/log/nginx/domain.com_access_log;
error_log /var/log/nginx/domain.com_error_log;

Leaving the defaults in /etc/nginx/nginx.conf shouldn't matter but the above should be followed (or very close to it) when doing multi domains for diagnostic purposes.

symlink support

from /etc/nginx/nginxconfig.io/php_fastcgi.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
change to
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;

Thank.

Cannot create directly /vat/www/_letsencrypt

When I run " # HTTPS - certbot (before first run): create ACME-challenge common directory"
I got error: "mkdir: cannot create directory โ€˜/var/www/_letsencryptโ€™: Permission denied"
Environment: AWS Ubuntu 18.04

Python support

This website is a very good idea.

I mainly use Python as a backend language (not PHP, have you ever tried Python? ;-) ). To use nginx with Python, the WSGI interface was defined. Do you think that Python support could be added to nginxconfig.io?

Some starting points could be:

use sites-available not sites-enabled

sites-enabled are intended to be symlinked from sites-available, allowing the ability to disable a site without deleting the config.

Details;

Change /etc/nginx/sites-enabled/example.com.conf to /etc/nginx/sites-available/example.com.conf

Add command ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf

Exclude specific path from /\. {deny all}

Hi. I am looking for advise. I using TeamCity server behind Nginx reverse proxy. Recently faced a problem when Nginx deny to download zip files from path my-site/some-url/.teamcity/coverage_idea/coverage.zip
My workaround looks like:
location ~ /\.(?!well-known|teamcity) { deny all; }
But I wish to be more precise. Should I include "allow-block" in reverse-proxy block?

subdomain redirects to www

Excuse me if im missing something here but won't this config always redirect to www.example.org, regardless of subdomain?

# non-www, subdomains redirect
server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        server_name .example.org;

        # SSL
        ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem;
        ssl_trusted_certificate /etc/letsencrypt/live/example.org/fullchain.pem;

        return 301 https://www.example.org$request_uri;
}

This is the default if you want both www redirect and a cdn(or any cdn for that matter)
Should it not be server_name example.org instead of .example.org

Preset switching has issues with order of applying properties

When using the "preset" section up top (switching between frontend, backend, Node.js etc.) some properties seems to be applied before the UI has been updated, leading to the new value/setting not registering properly. I noticed this with the Routing tab, connected to the PHP enabled setting.

To easily reproduce, apply either the Frontend or Node.js preset, any one where PHP is not enabled.
Then switch to to a preset where PHP is enabled and the index is index.php, such as backend, Wordpress or Drupal.

At this point PHP becomes enabled, but the index is never set to index.php.

If at this point you click the preset button again, same one again, the index is set to the correct value.

My guess/assumption is that the php setting is applied after the index setting, thus invalidating the new index setting as it tries to apply it before index.php is considered a valid choice.

Attaching a screen recording of the issue.
nginxconfig

Choosing custom SSL still inserts let's encrypt paths

In the subdomain section.

	# subdomains redirect
	server {
		listen 443 ssl http2;
		listen [::]:443 ssl http2;
	
		server_name *.my.domain.com;
	
		# SSL
		include _ssl.conf;
		ssl_certificate /etc/letsencrypt/live/my.domain.com/fullchain.pem;
		ssl_certificate_key /etc/letsencrypt/live/my.domain.com/privkey.pem;
	
		return 301 https://my.domain.com$request_uri;
	}

Server name missing when Modularized structure is unchecked

When creating a new config and unchecking the Modularized structure under common tools section, the server_name, redirect, and ssl_trusted_certificate directives lose the domain.

      `server {
	listen :443 ssl http2;
	listen []:443 ssl http2;

	server_name ;
	set $base /srv/www/domains/domain.com/magento/v230;
	root $base;

	# SSL
	ssl_certificate /etc/letsencrypt/live/magento.domain.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/magento.domain.com/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live//chain.pem; `

And the redirect server block:

   `# HTTP redirect
server {
	listen :80;
	listen []:80;

	server_name .;

	# ACME-challenge
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/_letsencrypt;
	}

	location / {
		return 301 https://$request_uri;
	}
}`

It also appears that the listen port is incorrect and the : is not required for ipv4 and the ipv6 listen should be [::]

Feature request: Proxy for node.js application

Hi. First of all, I must thank you for a great tool.
Did I miss it or there is no functionality for proxying specific ports?

In my case, there is a Node application that works on port 3000 (http://127.0.0.1:3000) and can be accessible from outside, even without Nginx. It would be great to add functionality to generate config for proxying all incoming traffic on port 80 (443) to specific port. Just like that:

location @server.app {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;

Perhaps it can be done via upstream? Really, I dont know, still new to Nginx:

http {
  upstream server.app {
    server 127.0.0.1:3000
}
  server {
    listen 80;
    server_name www.domain.com;
    location / {
      proxy_pass http://server.app 
    }
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.