Skip to content

Instantly share code, notes, and snippets.

@prantlf
Forked from foxxyz/nginx.conf
Last active September 29, 2019 12:15
Show Gist options
  • Select an option

  • Save prantlf/a30e1c94b395ecf97ff6164d3d8179d6 to your computer and use it in GitHub Desktop.

Select an option

Save prantlf/a30e1c94b395ecf97ff6164d3d8179d6 to your computer and use it in GitHub Desktop.

Revisions

  1. prantlf revised this gist Sep 29, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ http {
    server {
    # Serve the content at http://localhost:9001.
    server_name localhost;
    listen 8888;
    listen 9001;

    # Serve files from the current directory and its descenadants.
    root .;
  2. prantlf revised this gist Sep 29, 2019. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    # Extremely basic development setup to serve the current directory
    # at http://localhost:9001.
    # Start nginx in this directory with `nginx -p . -c nginx.conf`.
    # Stop nginx with `nginx -p . -s stop`.
    # Simple development setup to serve a directory at http://localhost:9001.
    # Start nginx in the directory to serve with `nginx -c ~/nginx.conf`.

    # When using a laptop with an above average equipment. 2 workers
    # significantly increase the throughput. 4 workers still help
    @@ -33,7 +31,7 @@ http {
    server {
    # Serve the content at http://localhost:9001.
    server_name localhost;
    listen 9001;
    listen 8888;

    # Serve files from the current directory and its descenadants.
    root .;
  3. prantlf revised this gist Aug 31, 2019. 1 changed file with 50 additions and 18 deletions.
    68 changes: 50 additions & 18 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,53 @@
    # Extremely basic development setup to serve the current directory at http://localhost:9001
    # Start nginx in this directory with `nginx -p . -c nginx.conf`
    # Stop nginx with `nginx -p . -s stop`
    events {}
    # Extremely basic development setup to serve the current directory
    # at http://localhost:9001.
    # Start nginx in this directory with `nginx -p . -c nginx.conf`.
    # Stop nginx with `nginx -p . -s stop`.

    # When using a laptop with an above average equipment. 2 workers
    # significantly increase the throughput. 4 workers still help
    # noticeably. The server slows down With more than 6 workers.
    worker_processes 2;
    events {
    accept_mutex off;
    }

    # Run as a foreground process and print errors on the console.
    daemon off;
    error_log stderr;

    http {
    # Serve files with correct mimetypes on OSX
    # location may have to be adjusted depending on your OS and nginx install
    include /usr/local/etc/nginx/mime.types;
    # Serve files with correct mimetypes on OSX. The location may have to
    # be adjusted depending on your OS and nginx installation.
    include /usr/local/etc/nginx/mime.types;

    # Improve the speed of processing requests, even a little.
    access_log off;

    # Optimise serving lots of static files in a quick pace. Share buffers
    # betweek kernel and user spaces. Utilise the full TCP packet length.
    sendfile on;
    sendfile_max_chunk 1m;
    tcp_nopush on;
    tcp_nodelay on;

    server {
    # Serve the content at http://localhost:9001.
    server_name localhost;
    listen 9001;

    server {
    listen 9001;
    access_log http.access.log;
    error_log http.error.log;

    root .;
    location / {

    }
    }
    }
    # Serve files from the current directory and its descenadants.
    root .;
    # Generate directory listings for paths ending with /.
    autoindex on;
    # Enable the HTTP response compression.
    gzip on;
    # Prevent the browser from fetching the content again if the page reloads
    # very quickly. 5s should be short enough for switching to an editor,
    # saving a change, switching back to the browser and reloading the page.
    expires 5;
    # Do not compute file content or state hashes. The last modification time
    # with the usual file system precision 2s should be enough to support
    # the content validation.
    etag off;
    }
    }
  4. @foxxyz foxxyz revised this gist Sep 29, 2015. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -4,16 +4,18 @@
    events {}

    http {
    include /usr/local/etc/nginx/mime.types;
    # Serve files with correct mimetypes on OSX
    # location may have to be adjusted depending on your OS and nginx install
    include /usr/local/etc/nginx/mime.types;

    server {
    listen 9001;
    access_log http.access.log;
    error_log http.error.log;

    root .;
    location / {

    server {
    listen 9001;
    access_log http.access.log;
    error_log http.error.log;

    root .;
    location / {

    }
    }
    }
    }
  5. @foxxyz foxxyz created this gist Sep 29, 2015.
    19 changes: 19 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # Extremely basic development setup to serve the current directory at http://localhost:9001
    # Start nginx in this directory with `nginx -p . -c nginx.conf`
    # Stop nginx with `nginx -p . -s stop`
    events {}

    http {
    include /usr/local/etc/nginx/mime.types;

    server {
    listen 9001;
    access_log http.access.log;
    error_log http.error.log;

    root .;
    location / {

    }
    }
    }