Nginx Proxy and Spring Application context

I am having some issue configuring the Nginx Proxy to work with Confluence. I have Confluence configured and serving on localhost:8090 which I am using Nginx proxy configuration from the official documentation. I did not set a "/confluence" context path as I prefer to keep it at the root level. However, as soon as I started Nginx after Confluence is running, there are large amount of stack traces thrown with similar detail as below.

Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getLocale' in  class com.atlassian.confluence.core.ConfluenceActionSupport threw exception java.lang.IllegalStateException: Spring Application context has not been set at /decorators/includes/header.vm[line 58, column 41]
        at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
        at org.apache.velocity.context.ProxyVMContext.get(ProxyVMContext.java:222)
        at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:843)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:222)
        at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.runtime.parser.node.ASTStringLiteral.value(ASTStringLiteral.java:290)
        at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
        at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
        at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
        at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
        at com.atlassian.confluence.setup.velocity.TrimDirective.render(TrimDirective.java:33)
        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.runtime.directive.Parse.render(Parse.java:263)
        at com.atlassian.confluence.setup.velocity.ProfilingParseDirective.render(ProfilingParseDirective.java:21)
        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.Template.merge(Template.java:328)
        at org.apache.velocity.Template.merge(Template.java:235)
        at com.atlassian.confluence.util.velocity.VelocityUtils.renderTemplateWithoutSwallowingErrors(VelocityUtils.java:68)
        at com.atlassian.confluence.util.velocity.VelocityUtils.renderTemplateWithoutSwallowingErrors(VelocityUtils.java:76)
        at com.atlassian.confluence.util.profiling.ConfluenceSitemeshDecorator$StreamingResponseWritingStrategy.renderToResponse(ConfluenceSitemeshDecorator.java:291)
        ... 58 more

 

How can I make this work properly?

1 answer

0 vote
Ann Worley Atlassian Team Jun 27, 2017

The error you posted is almost identical to one of the ones listed on Confluence does not start due to Spring Application context has not been set. Please review the resolutions in the knowledge base article.

Are you reporting that you only see this error when the proxy is enabled? Does Confluence run as expected when you don't start NGINX? 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,943 views 27 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you