Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest NGINX equivalent for .htaccess to host a playground #1096

Open
0aveRyan opened this issue Mar 10, 2024 · 3 comments
Open

Latest NGINX equivalent for .htaccess to host a playground #1096

0aveRyan opened this issue Mar 10, 2024 · 3 comments
Labels
[Type] Documentation Improvements or additions to documentation [Type] Enhancement New feature or request

Comments

@0aveRyan
Copy link
Contributor

Just dropping the config I used for an Nginx box, few of these would probably be good for self-hosting docs once that's more realistic in the future.

	location ~* .wasm$ {
	  types {
	    application/wasm wasm;
	  }
	}

	location ~* .data$ {
	  types {
	    application/octet-stream data;
	  }
	}

	location /scope:.* {
	  rewrite ^scope:.*?/(.*)$ $1 last;
	}

	# Enable Multiviews equivalent
	location / {
	    try_files $uri $uri/ @rewrite;
	}

	location @rewrite {
	    rewrite ^/(.*)$ /index.php?q=$1;
	}

	# Add gzip encoding for .gz files
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

	# Remove ETag and set Cache-Control for index.html
	location ~* ^/index\.html$ {
	    add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate";
	    add_header Pragma "no-cache";
	    add_header Expires "Wed, 11 Jan 1984 05:00:00 GMT";
	}

	# Set Access-Control-Allow-Origin and remove ETag, set Cache-Control for specific files
	location ~* ^/(index\.js|blueprint-schema\.json|wp-cli\.phar)$ {
	    add_header Access-Control-Allow-Origin "*";
	    add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate";
	    add_header Pragma "no-cache";
	    add_header Expires "Wed, 11 Jan 1984 05:00:00 GMT";
	}
@0aveRyan 0aveRyan changed the title Llatest NGINX equivalent for .htaccess to host a playground Latest NGINX equivalent for .htaccess to host a playground Mar 10, 2024
@adamziel adamziel added [Type] Documentation Improvements or additions to documentation [Type] Enhancement New feature or request labels Mar 11, 2024
@adamziel
Copy link
Collaborator

adamziel commented Mar 11, 2024

Thank you so much @0aveRyan! Would you be up for proposing it as a PR for the NGINX configuration documentation section? I know that section is a bit obscured at the moment, the documentation will get a structural overhaul in a short-to-medium-term future to make that section more visible and accessible.

@0aveRyan
Copy link
Contributor Author

0aveRyan commented Mar 11, 2024

@adamziel happy to add a PR. Had a lot of fun tinkering yesterday! I have a small short list I need to review of issues and perhaps open some here.

Partially wanted to start in an issue to see what kind of appetite there was for docs/etc. I know things are moving fast and didn't know if any other updates were in the works.

Also, noting for anyone who like me who does not breathe the nuances of NGINX and Apache every day... AI chatbots do fairly well going from one syntax to the other 😎

https://chat.openai.com/share/3b101d51-9e22-49f6-952f-6fcee3ef4344

@adamziel
Copy link
Collaborator

@0aveRyan There's quite a bit of an appetite for docs! See the following issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Documentation Improvements or additions to documentation [Type] Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants