Skip to content

hynra/nginx-disable-graphql-introspection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

nginx-disable-graphql-introspection

Disable GraphQL Introspection in Nginx using JS Module

http {

   ....
   server {
     ....
   }

}
  • in http scope, import the js file
js_import /etc/nginx/njs/introspect.js;
  • Add upstream to your Graphql backend
   # http scope
   upstream backend {
       # graphql server
       server localhost:8080;
   }
   
   # server scope
     location @app-backend {
       proxy_pass http://backend;
     }
  • validate all of requests with js code
     location / {
       js_content introspect.disableSchema;
     }

About

Disable GraphQL Introspection in Nginx using JS Module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published