# Oc-id service custom port

**URL:** <https://discourse.chef.io/t/oc-id-service-custom-port/10638>\
**Category:** Chef Infra (archive)\
**Created:** [March 27, 2017, 12:54am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638 "2017-03-27T00:54:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkeshark](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Post date:** [March 27, 2017, 12:54am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638/1 "2017-03-27T00:54:48Z")

</div>

Hi All,  
Default port on which oc-id service is running is 9090.  
is there any way to change this port to some other port via configuration?

i found the changes in config (chef-server.rb) file for below services but not able to find for oc-id  
erchef[‘port’] = 8000  
nginx[‘ssl\_port’] = 443

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![srenatus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/srenatus/32/1737_2.png) [@srenatus](https://discourse.chef.io/u/srenatus)\
**Post date:** [March 27, 2017, 10:03am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638/2 "2017-03-27T10:03:05Z")

</div>

That port is _internal_. nginx is reverse proxying oc-id (in the same way it does for erchef and the rest).

It’s possible to change it in a similar way to the other services (see [here](https://github.com/chef/chef-server/blob/07eb6618e24d7cc4afae7112aeb7deb67b55e0f2/omnibus/files/private-chef-cookbooks/private-chef/attributes/default.rb#L698)), but I’m not sure I understand why anyone would want this 😉

So…what are you trying to do?

Cheers  
Stephan

---

<div class="post-metadata">

**Author:** ![bkeshark](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Post date:** [March 28, 2017, 9:13am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638/3 "2017-03-28T09:13:30Z")

</div>

Thanks Stephan for your response.  
the generic ports in my organization has been reserved such as 9090. and same can not be used for applications other than those for which it is reserved.

will there be any issue if we change it from 9090 to some other port.

---

<div class="post-metadata">

**Author:** ![srenatus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/srenatus/32/1737_2.png) [@srenatus](https://discourse.chef.io/u/srenatus)\
**Post date:** [March 28, 2017, 11:00am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638/4 "2017-03-28T11:00:12Z")

</div>

> will there be any issue if we change it from 9090 to some other port.

It should just work, but there's no way to tell without trying. (_"The proof of the pudding is in the eating."_) Please [file an issue](https://github.com/chef/chef-server/issues) if it doesn't work.

To try it, you would add this to your chef-server.rb:

```
oc_id['port'] = 19090 # whatever you can use

```

You should then find, after `chef-server-ctl reconfigure`, that it uses a different port:

```
# netstat -lnp | grep :19090
tcp 0 0 127.0.0.1:19090 0.0.0.0:* LISTEN 7868/rails master -

```

and that chef-server's nginx knows about that, too:

```
# grep -R 19090 /var/opt/opscode/nginx/etc/
/var/opt/opscode/nginx/etc/addon.d/40-oc_id_upstreams.conf: server 127.0.0.1:19090;

```

---

<div class="post-metadata">

**Author:** ![bkeshark](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@bkeshark](https://discourse.chef.io/u/bkeshark)\
**Post date:** [March 28, 2017, 11:12am UTC](https://discourse.chef.io/t/oc-id-service-custom-port/10638/5 "2017-03-28T11:12:09Z")

</div>

Thanks a lot Stephan.  
You helped me right when I needed help most.
