DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Spring Data Neo4j: How to Update an Entity
  • Leveraging Neo4j for Effective Identity Access Management
  • The Beginner's Guide To Understanding Graph Databases
  • How To Verify Database Connection From a Spring Boot Application

Trending

  • The Role of Retrieval Augmented Generation (RAG) in Development of AI-Infused Enterprise Applications
  • It’s Not About Control — It’s About Collaboration Between Architecture and Security
  • Understanding Java Signals
  • A Guide to Developing Large Language Models Part 1: Pretraining
  1. DZone
  2. Data Engineering
  3. Databases
  4. Using NGINX to Proxy a Neo4j Instance [Snippets]

Using NGINX to Proxy a Neo4j Instance [Snippets]

Need to remotely connect to your Neo4j instance? Here's how to use a reverse proxy server (NGINX here) to help you gain access to your graph database.

By 
Stefan Armbruster user avatar
Stefan Armbruster
·
May. 21, 18 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
7.8K Views

Join the DZone community and get the full member experience.

Join For Free

There are cases when you want to access your Neo4j instance remotely and you live in an environment where direct access is not possible. This might be caused by technical or organizational restrictions.

One generic solution to this kind of problem is using a VPN. Another alternative to be discussed in this blog post is using a reverse proxy server. I want to show how you can proxy Neo4j using NGINX.

First of all, run a neo4j instance. In order to not have false positive results, I’m using non-standard ports for HTTP (default 7474, using 17474 here) and bolt (default 7687, using 17687 here). Spinning up a test instance is easy in Docker:

docker run --rm -e NEO4J_AUTH=none -p 17474:7474 -p 17687:7687 neo4j 


Note that I’ve switched off authentication, something that might be ok for testing, but is a clear no-go for any other kind of usage.

I’m installing NGINX directly on my system:

apt install nginx


Then we need to map both communication channels: HTTP and bolt. For the HTTP part, we add the following inside the server section of /etc/nginx/sites-available/default this snippet:

location /browser/ {<br/> proxy_pass http://localhost:17474/; # <-- replace with your neo4j instance's http servername + port<br /> }


For the bolt protocol, we amend to /etc/nginx/nginx.conf:

stream {
    server {<br/>listen 7687;<br/> proxy_pass localhost:17687; # <--- replace this with your neo4j server and bolt port<br />    }<br />}


After a restart of NGINX, pointing your browser to http://localhost/browser should show the Neo4j browser.

Neo4j

Published at DZone with permission of Stefan Armbruster, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Spring Data Neo4j: How to Update an Entity
  • Leveraging Neo4j for Effective Identity Access Management
  • The Beginner's Guide To Understanding Graph Databases
  • How To Verify Database Connection From a Spring Boot Application

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: