Skip to content

Instantly share code, notes, and snippets.

@reaandrew
Last active May 5, 2022 11:34
Show Gist options
  • Select an option

  • Save reaandrew/07e55bcd4009e22beb1f039da6b8e82f to your computer and use it in GitHub Desktop.

Select an option

Save reaandrew/07e55bcd4009e22beb1f039da6b8e82f to your computer and use it in GitHub Desktop.

Revisions

  1. reaandrew revised this gist May 5, 2022. 1 changed file with 126 additions and 0 deletions.
    126 changes: 126 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,126 @@
    #user nobody;
    worker_processes 1;

    #error_log logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;

    #pid logs/nginx.pid;


    events {
    worker_connections 1024;
    }


    http {
    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 main;

    sendfile on;
    #tcp_nopush on;

    #keepalive_timeout 0;
    keepalive_timeout 65;

    #gzip on;
    #
    auth_jwt_key '/kGaGfCZgwdIpp1D4b847MeHD4AEYsmHwmIvAk3njlo=';

    server {
    listen 8080;
    server_name localhost;

    #charset koi8-r;

    #access_log logs/host.access.log main;

    location / {
    auth_jwt on;
    root /usr/local/nginx/conf/html;
    index index.html index.htm;
    }

    location /protected {
    auth_jwt on;
    alias /usr/local/nginx/conf/html_protected;
    index index.html index.htm;
    }


    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    # root html;
    # fastcgi_pass 127.0.0.1:9000;
    # fastcgi_index index.php;
    # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    # include fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    # listen 8000;
    # listen somename:8080;
    # server_name somename alias another.alias;

    # location / {
    # root html;
    # index index.html index.htm;
    # }
    #}


    # HTTPS server
    #
    #server {
    # listen 443 ssl;
    # server_name localhost;

    # ssl_certificate cert.pem;
    # ssl_certificate_key cert.key;

    # ssl_session_cache shared:SSL:1m;
    # ssl_session_timeout 5m;

    # ssl_ciphers HIGH:!aNULL:!MD5;
    # ssl_prefer_server_ciphers on;

    # location / {
    # root html;
    # index index.html index.htm;
    # }
    #}

    }
  2. reaandrew created this gist May 5, 2022.
    4 changes: 4 additions & 0 deletions nginx-downloads.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    curl -LO https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.gz
    curl -LO http://zlib.net/zlib-1.2.12.tar.gz
    curl -LO https://www.openssl.org/source/openssl-3.0.3.tar.gz
    curl -LO https://nginx.org/download/nginx-1.21.6.tar.gz